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."