First Division strugglers Ayr United stunned St Mirren with a late goal in Paisley to claim a League Cup semi-final place.
Chris Smith headed in an excellent free kick from Eddie Malone on 81 minutes as the visitors grew in confidence after the interval.
St Mirren threw men forward in the closing stages and Graham Carey struck the crossbar deep into injury time.
Ayr had previously knocked Inverness and Hearts out of the competition.
And the Somerset Park club made it a hat-trick of Scottish Premier League scalps thanks to a resolute defensive display.
Saints had the bulk of territory but faded after the interval and Smith struck during a jittery period for the home side.
A late Buddies rally resulted in a few nervous moments in the Ayr penalty box but the visitors held on to the delight of their small band of followers.
St Mirren started brightly and David van Zanten was not too far away with a shot that dipped just over the crossbar.
Steven Thompson then saw an opportunity squandered when he rose highest in a packed goalmouth and nodded just over from a Kenny McLean corner.
Saints continued to pile on the pressure and an angled pass from Paul McGowan found Thomson for the header, with Cuthbert slipping before recovering to claw the effort past the upright.
McLean passed up a decent chance to open the scoring early in the second half when he met a Jim Goodwin cross and saw his header flash across the face of goal.
The game grew increasingly disjointed with basic errors creeping into St Mirren's play.
And the SPL side were left ruining missed opportunities when Ayr went in front from Smith's smart downward header.
The game finished with St Mirren laying siege to Cuthbert's goal and Carey was denied the leveller by the crossbar deep into injury time.
St Mirren manager Danny Lennon : "It's very disappointing. It was a wonderful opportunity for us, but I must give Ayr United credit for sticking to their game-plan - certainly not the performance, but the game-plan.
"It's a sore one, but we will try to pick ourselves up very quickly.
"We certainly know that we need that cutting edge.
"That's not just been the case tonight for us, it's been over the last few weeks and maybe even from the beginning of the season."
Ayr United defender Chris Smith : "Hearts are probably the biggest team we have beaten, but our away results have been pretty poor in the league to be honest, so this one was the best for us and it got us to Hampden as well.
"It was good to get the clean-sheet and the win.
"It was great and it's even better when you get the winning goal yourself and take your team to Hampden. There's no better feeling than that.
"In the first half, we were under pressure a bit and St Mirren had most of the possession.
"But I felt we came out in the second half and were more in control of the game.
"We had a lot of set-plays and we just had to take one of them."
Live Text Commentary
Full Time The match has reached full-time.90:00 +3:45
Inswinging corner taken from the left by-line by Paul McGowan, Unfair challenge on Kevin Cuthbert by Steven Thompson results in a free kick. Kevin Cuthbert takes the free kick.90:00 +3:11
The ball is swung over by Paul McGowan, Header from deep inside the area by David van Zanten goes harmlessly over the crossbar.90:00 +2:46
Jon McShane takes a shot.90:00 +2:40
The ball is crossed by Paul McGowan.90:00 +2:16
Gareth Wardlaw takes a shot.89:10
Shot from 35 yards by Marc McAusland went over the net.88:36
The assistant referee flags for offside against Micheal McGowan. Free kick taken by Craig Samson.87:44
Nigel Hasselbaink produces a right-footed shot from deep inside the six-yard box which goes wide of the left-hand post.86:06
The ball is swung over by Nigel Hasselbaink, clearance made by Micheal McGowan.84:19 Substitution
Substitution Jon McShane replaces Jim Goodwin.83:16
Micheal McGowan produces a cross, Lee Mair makes a clearance.81:49
Nigel Hasselbaink delivers the ball.80:49
Assist on the goal came from Edward Malone.80:49 Goal scored
Goal! - Christopher Smith - St Mirren 0 - 1 Ayr Christopher Smith scores a headed goal from inside the box. St Mirren 0-1 Ayr.80:01
Jim Goodwin challenges Ross Robertson unfairly and gives away a free kick. Edward Malone produces a cross,79:10
Nigel Hasselbaink is adjudged to have handled the ball. Kevin Cuthbert restarts play with the free kick.78:14
Jeroen Tesselaar is flagged offside by the assistant referee. Kevin Cuthbert restarts play with the free kick.75:48
Corner taken by Graham Carey, Lee Mair has a headed effort at goal from deep inside the area missing to the left of the target.75:42
A cross is delivered by Steven Thompson, Christopher Smith gets a block in.
Edward Malone challenges Graham Carey unfairly and gives away a free kick. Free kick crossed left-footed by Graham Carey from right wing, clearance made by Alan Trouten.73:59
Nigel Hasselbaink takes the chance to get an effort at goal. Comfortable save by Kevin Cuthbert.73:26 Booking
Booking Gareth Wardlaw goes into the referee's book for unsporting behaviour.73:14
Free kick awarded for a foul by Gareth Wardlaw on Kenny McLean. Marc McAusland restarts play with the free kick.72:27
Shot from deep inside the area by Paul McGowan clears the bar.71:12
Paul McGowan challenges Gareth Wardlaw unfairly and gives away a free kick. Micheal McGowan delivers the ball from the free kick right-footed from left wing, clearance by Lee Mair.70:28
Foul by Jim Goodwin on Andrew Geggan, free kick awarded. Edward Malone restarts play with the free kick.68:22 Substitution
Substitution Graham Carey is brought on as a substitute for Gary Teale.67:59
Gary Teale crosses the ball, save made by Kevin Cuthbert.66:12
Inswinging corner taken from the left by-line by Micheal McGowan.64:58
Kenny McLean gives away a free kick for an unfair challenge on Jonathan Tiffoney. Free kick crossed right-footed by Micheal McGowan, clearance made by Jeroen Tesselaar.64:03
Corner taken by Micheal McGowan, Marc McAusland manages to make a clearance.63:56
Gareth Wardlaw delivers the ball, David van Zanten gets a block in.62:34
Unfair challenge on Micheal McGowan by Nigel Hasselbaink results in a free kick. Kevin Cuthbert restarts play with the free kick.59:59
The offside flag is raised against Nigel Hasselbaink. Kevin Cuthbert takes the direct free kick.58:55
Edward Malone takes the indirect free kick.58:55 Booking
Booking Jeroen Tesselaar booked for unsporting behaviour.58:49
Free kick awarded for a foul by Jeroen Tesselaar on Micheal McGowan.58:10
The assistant referee flags for offside against Nigel Hasselbaink. Kevin Cuthbert takes the free kick.56:27 Substitution
Substitution Nigel Hasselbaink comes on in place of Steven Thomson.55:56
Corner taken by Micheal McGowan, Steven Thompson makes a clearance.54:49
Corner taken right-footed by Micheal McGowan from the right by-line to the near post, clearance by David van Zanten.54:44
A cross is delivered by Jonathan Tiffoney, Lee Mair gets a block in.53:09
A cross is delivered by Edward Malone, Micheal McGowan challenges Jeroen Tesselaar unfairly and gives away a free kick. Free kick taken by Craig Samson.52:28
Steven Thompson is flagged offside by the assistant referee. Free kick taken by Kevin Cuthbert.51:41
Free kick awarded for an unfair challenge on Ross Robertson by Gary Teale. Kevin Cuthbert takes the indirect free kick.50:33
Corner taken right-footed by Micheal McGowan from the left by-line, clearance made by Steven Thompson.48:55
The ball is sent over by Jim Goodwin, Header by Kenny McLean from deep inside the penalty area misses to the left of the target.48:12 Booking
Booking Alan Trouten receives a yellow card.48:02
Free kick awarded for a foul by Alan Trouten on Kenny McLean. Lee Mair takes the indirect free kick.47:39
The ball is crossed by Jeroen Tesselaar, save by Kevin Cuthbert.47:15
Gareth Wardlaw delivers the ball.46:02
Steven Thomson sends in a cross.45:20
Free kick awarded for a foul by Micheal McGowan on Paul McGowan. Jim Goodwin takes the free kick.45:01
The referee gets the second half started.45:00 +1:12 Half time
Half Time The referee blows for half time.45:00 +0:02
David van Zanten delivers the ball, clearance made by Andrew Geggan.43:49
The assistant referee signals for offside against Paul McGowan. Kevin Cuthbert takes the free kick.42:02
A cross is delivered by Kenny McLean.39:20
Unfair challenge on Paul McGowan by Jonathan Tiffoney results in a free kick. Free kick crossed right-footed by Gary Teale, save by Kevin Cuthbert.37:24
Gareth Wardlaw challenges Marc McAusland unfairly and gives away a free kick. Indirect free kick taken by Jim Goodwin.36:57
Jeroen Tesselaar produces a cross, Steven Thompson takes a shot. Save by Kevin Cuthbert.33:50
Short corner taken by Gary Teale.33:25
The ball is delivered by Paul McGowan, Chance falls to Steven Thomson who heads at goal, save by Kevin Cuthbert.32:08
Handball decision goes against Alan Trouten. Indirect free kick taken by Gary Teale.30:41
Corner taken by Gary Teale from the left by-line, Steven Thompson has a header from inside the six-yard box and clears the crossbar.30:34
Jeroen Tesselaar sends in a cross, blocked by Jonathan Tiffoney.28:26
A cross is delivered by Jeroen Tesselaar, Christopher Smith makes a clearance.27:22
A cross is delivered by Jeroen Tesselaar, Kevin Cuthbert makes a save.23:48
Steven Thomson challenges Andrew Geggan unfairly and gives away a free kick. Indirect free kick taken by Christopher Smith.22:24
Effort on goal by Kenny McLean from long distance goes over the crossbar.18:31
Outswinging corner taken by Micheal McGowan from the right by-line.17:19
Gareth Wardlaw fouled by Jim Goodwin, the ref awards a free kick. Edward Malone restarts play with the free kick.16:03
The referee penalises Kenny McLean for handball. Direct free kick taken by Kevin Cuthbert.14:10
Gary Teale takes the inswinging corner, Marc McAusland concedes a free kick for a foul on John Robertson. Free kick taken by Kevin Cuthbert.14:03
The ball is sent over by Steven Thompson, blocked by Jonathan Tiffoney.13:14
The ball is delivered by David van Zanten, clearance by Christopher Smith.10:22
Christopher Smith challenges Steven Thompson unfairly and gives away a free kick. The free kick is delivered right-footed by Gary Teale from right wing, Steven Thompson concedes a free kick for a foul on Christopher Smith. Kevin Cuthbert takes the indirect free kick.8:35
Inswinging corner taken right-footed by Micheal McGowan, Steven Thompson manages to make a clearance.8:29
Centre by Gareth Wardlaw, Jeroen Tesselaar manages to make a clearance.6:48
The ball is delivered by Gary Teale, save made by Kevin Cuthbert.5:13
The ball is delivered by Gary Teale.4:30
Foul by Jonathan Tiffoney on Paul McGowan, free kick awarded. Indirect free kick taken by Jim Goodwin.3:26
Effort from just outside the area by David van Zanten goes over the bar.2:22
Gary Teale takes the free kick.2:22 Booking
Booking Ross Robertson booked for unsporting behaviour.2:18
Free kick awarded for a foul by Ross Robertson on Steven Thomson.2:01
Free kick awarded for a foul by Micheal McGowan on Paul McGowan. Indirect free kick taken by Paul McGowan.0:50
A cross is delivered by Kenny McLean, Ross Robertson makes a clearance.0:00
The match has kicked off.
Live data and text provided by our data suppliers