Ayr United came from behind to defeat Falkirk and secure a Scottish Cup quarter-final against Hibernian.
Blair Alston put the visitors ahead with a powerful header from a Craig Sibald cross after six minutes.
But Andy Geggan forced the leveller after an Adam Dodd drive struck the underside of the bar 13 minutes later.
And, when Darren Dods handled from a Michael McGowan cross 12 minutes after the break, Mark Roberts struck the penalty into the corner.
It ensured that part-timers Ayr remain on course for their second semi-final of the season, having lost to Kilmarnock in the Scottish Communities League Cup.
Yet it looked like the Bairns were destined to host Hibs in the next round when their early dominance produced a deserved opener.
Sibald's cross was met superbly by Alston, a pre-match injury doubt, to put Steven Pressley's youthful side ahead.
Falkirk's leading goalscorer, Farid El Alagui, who had returned from suspension, squandered a chance to put the visitors further ahead.
The sides had shared two draws in their previous First Division meetings this season despite the Bairns chasing promotion and Ayr battling to avoid the drop.
Another tight affair was ensured when cup specialists Ayr struck back.
Dodd's 18-yard effort struck the bar and, with the fans wondering if it had bounced over the line, Geggan headed in to make sure from close range.
Falkirk felt aggrieved when referee Crawford Allan ignored cries for a penalty when Sibald went past Chris Smith then Eddie Malone before going down following the latter's challenge.
Geggan came to the rescue of Brian Reid's Ayr side when he headed off the line under pressure from Dods.
However, the home side took control after the break and went ahead when Dods inexplicably handled after McGowan twisted and turned before sending a dangerous cross into the penalty box.
Veteran striker Roberts, so often the scorer of vital goals on big occasions, coolly placed the spot kick into the corner.
It was the introduction of McGowan just after the break that appeared to turn the game and the winger claimed for another penalty when his cross struck the hand of Murray Wallace.
Nothing was given on that occasion and Ayr could have found themselves pegged back had goalkeeper Kevin Cuthbert not dived full length to turn a fine El Alagui header round the post.
A Geggan effort struck the post from another McGowan cross, but it was Falkirk who went closest in the dying moments.
Substitute Jordan White perhaps should have done better than divert a Dods effort over the crossbar and it is Ayr who progress to host Pat Fenlon's Hibs.
Ayr United manager Brian Reid : "I am absolutely delighted. The second-half performance was different class and we could have won by more.
"Falkirk get a lot of plaudits for being a good passing team, but you see in that second half we outpassed and outplayed them and it just shows you what we are capable of here.
"Another quarter-final to look forward to is just superb and Hibs will be coming here knowing they can't underestimate us.
"We beat them here a season ago, we're looking forward to it and we have to start taking that form into the league."
Falkirk manager Steven Pressley : "It was a first half in which we had total domination of the football. Some of our passing and play and possession was terrific.
"And it was was just disappointing to go in at half-time level because I think Ayr scored from probably their first attack.
"But, in the second half, we didn't pass the ball with the same fluency and, to be fair to Ayr, they came into the game and probably created by far the better chances in the second half.
"Certainly, I felt it was a penalty kick, but I still think, excluding that, we have to pass the ball with better speed and confidence."
- 01 Cuthbert
- 02 Tiffoney
- 03 Malone
- 04 Campbell Booked (Wardlaw - 71' )
- 05 Smith
- 06 Geggan
- 07 Dodd
- 08 Tomsett Booked
- 11 Trouten (McGowan - 51' )
- 09 Moffat
- 10 Roberts
- 20 McWilliams
- 16 Robertson
- 12 McGowan
- 15 McKernan
- 14 Wardlaw
- 01 McGovern
- 02 Duffy
- 03 Scobbie
- 04 Dods
- 05 Wallace Booked
- 06 Murdoch
- 07 Alston (Jay Fulton - 78' )
- 08 Millar Booked
- 11 Sibbald (Bennett - 83' )
- 09 El Alagui
- 10 Gibson (White - 69' Booked )
- 20 Bowman
- 12 Bennett
- 14 Stephen Kingsley
- 15 Jay Fulton
- 16 White
Live Text Commentary
Full Time The referee blows for the end of the match.90:00 +1:41
Corner from the right by-line taken by Mark Millar, Jordan White has a headed effort from close in and clears the bar.89:33
Indirect free kick taken by Liam Tomsett.89:33 Booking
Booking Mark Millar goes into the referee's book.89:19
Free kick awarded for an unfair challenge on Gareth Wardlaw by Mark Millar.87:58
Gareth Wardlaw challenges Thomas Scobbie unfairly and gives away a free kick. Thomas Scobbie takes the free kick.86:20
Indirect free kick taken by Jonathan Tiffoney.86:20 Booking
Booking Jordan White booked for unsporting behaviour.85:50
Jonathan Tiffoney fouled by Jordan White, the ref awards a free kick.84:52
Mark Roberts takes a shot. Save by Michael McGovern.83:56
Micheal McGowan takes the direct free kick.83:56 Booking
Booking Murray Wallace is cautioned by the ref for unsporting behaviour.83:38
Murray Wallace concedes a free kick for a foul on Andrew Geggan.82:23 Substitution
Substitution Rhys Bennett replaces Craig Sibbald.80:06
Micheal McGowan crosses the ball, Header from close range by Andrew Geggan bounces off the post.77:34
Indirect free kick taken by Kevin Cuthbert.77:34 Substitution
Substitution Jay Fulton is brought on as a substitute for Blair Alston.77:34
Edward Malone fouled by Blair Alston, the ref awards a free kick.76:44
Shot from just outside the area by Kieran Duffie goes over the bar.74:36
Foul by Gareth Wardlaw on Michael McGovern, free kick awarded. Michael McGovern restarts play with the free kick.
Michael McGovern fouled by Mark Roberts, the ref awards a free kick. Indirect free kick taken by Michael McGovern.70:31 Substitution
Substitution Gareth Wardlaw is brought on as a substitute for Martyn Campbell.69:11
Mark Millar takes the free kick.69:11 Booking
Booking Martyn Campbell receives a yellow card for unsporting behaviour.69:00
Free kick awarded for an unfair challenge on Farid El Alagui by Martyn Campbell.68:18 Substitution
Substitution Jordan White joins the action as a substitute, replacing William Gibson.67:20
Craig Sibbald takes a shot. Save by Kevin Cuthbert.66:26
The referee blows for offside against Farid El Alagui. Martyn Campbell restarts play with the free kick.65:50
Corner taken by Mark Millar from the left by-line.65:20
Farid El Alagui takes a shot. Kevin Cuthbert makes a save.64:43
Corner taken by Mark Millar from the right by-line, Edward Malone makes a clearance.64:32
The ball is crossed by Kieran Duffie, Martyn Campbell manages to make a clearance.63:35
The ball is swung over by Micheal McGowan, Darren Dods makes a clearance.62:30
Martyn Campbell challenges Farid El Alagui unfairly and gives away a free kick. Mark Millar restarts play with the free kick.60:46
Michael Moffat gives away a free kick for an unfair challenge on Darren Dods. Darren Dods takes the free kick.59:52
Liam Tomsett fouled by William Gibson, the ref awards a free kick. Free kick taken by Liam Tomsett.57:31
Kieran Duffie gives away a free kick for an unfair challenge on Adam Dodd. Edward Malone takes the free kick.57:00 Goal scored
Goal! - Mark Roberts - Ayr 2 - 1 Falkirk Mark Roberts scores a placed penalty. Ayr 2-1 Falkirk.56:11
The referee penalises Darren Dods for handball.55:19
Corner taken by Micheal McGowan from the left by-line played to the near post, clearance made by Darren Dods.54:10
Liam Tomsett gives away a free kick for an unfair challenge on Blair Alston. Mark Millar crosses the ball in from the free kick, save made by Kevin Cuthbert.51:46
Corner taken right-footed by Micheal McGowan from the left by-line to the near post, Kieran Duffie manages to make a clearance.50:48 Substitution
Substitution Alan Trouten goes off and Micheal McGowan comes on.48:45
Free kick awarded for a foul by Stewart Murdoch on Mark Roberts. Mark Roberts takes the free kick.47:38
Corner from right by-line taken by Mark Millar.47:04
Farid El Alagui concedes a free kick for a foul on Edward Malone. Edward Malone takes the indirect free kick.45:01
The second half has started.45:00 +0:05 Half time
Half Time The match has reached half-time.44:03
Corner taken by Mark Millar, Liam Tomsett manages to make a clearance.41:26
The referee blows for offside against Farid El Alagui. Indirect free kick taken by Kevin Cuthbert.38:00
Inswinging corner taken right-footed by Mark Millar played to the near post, clearance made by Mark Roberts.36:07
Foul by Liam Tomsett on William Gibson, free kick awarded. The ball is crossed by Mark Millar, Farid El Alagui has a headed effort at goal from deep inside the area missing to the right of the goal.35:12
Unfair challenge on Mark Millar by Alan Trouten results in a free kick. Mark Millar takes the indirect free kick.33:57
Outswinging corner taken from the right by-line by Mark Millar, clearance by Mark Roberts.31:45
Shot from just outside the penalty area by William Gibson misses to the left of the target.29:01
Mark Roberts is ruled offside. Free kick taken by Michael McGovern.18:36
Adam Dodd takes a shot.19:54
Corner taken by Mark Millar, Farid El Alagui takes a shot. Clearance made by Mark Roberts.18:39
The assist for the goal came from Adam Dodd.18:39 Goal scored
Goal! - Andrew Geggan - Ayr 1 - 1 Falkirk Andrew Geggan scores a headed goal from inside the six-yard box. Ayr 1-1 Falkirk.16:57
Unfair challenge on Alan Trouten by William Gibson results in a free kick. Indirect free kick taken by Liam Tomsett.16:13
Free kick taken by Mark Millar.16:13 Booking
Booking Liam Tomsett is given a yellow card.15:58
Liam Tomsett concedes a free kick for a foul on William Gibson.15:21
A cross is delivered by Jonathan Tiffoney, Murray Wallace gets a block in.14:27
The ball is crossed by Kieran Duffie, clearance by Christopher Smith.12:06
Craig Sibbald challenges Andrew Geggan unfairly and gives away a free kick. Kevin Cuthbert restarts play with the free kick.10:39
Andrew Geggan concedes a free kick for a foul on Craig Sibbald. Mark Millar takes the free kick.10:17
Stewart Murdoch gives away a free kick for an unfair challenge on Mark Roberts. Direct free kick taken by Mark Roberts.9:16
Close range effort by Farid El Alagui clears the crossbar.8:25
Mark Millar fouled by Mark Roberts, the ref awards a free kick. Mark Millar takes the free kick.5:37
Assist on the goal came from Thomas Scobbie.5:37 Goal scored
Goal! - Blair Alston - Ayr 0 - 1 Falkirk Blair Alston grabs a headed goal from inside the penalty area. Ayr 0-1 Falkirk.2:39
Free kick awarded for a foul by Stewart Murdoch on Mark Roberts. Indirect free kick taken by Christopher Smith.2:05
Farid El Alagui gives away a free kick for an unfair challenge on Martyn Campbell. Christopher Smith takes the free kick.0:14
Edward Malone challenges William Gibson unfairly and gives away a free kick. Mark Millar takes the free kick.0:00
The match has kicked off.
Live data and text provided by our data suppliers