St Mirren clambered off the canvas to stun Hearts and secure a Scottish Cup quarter-final replay in Paisley.
Graham Carey's first-half free-kick from 20 yards put Saints in front as they bossed the opening exchanges.
However, Craig Beattie replied with a header and crossed for substitute Rudi Skacel to put the Edinburgh side ahead on 48 minutes.
St Mirren looked out, but Marius Zaliukas deflected Nigel Hasslebaink's effort into his own net to level.
The Scottish Premier League rivals will do battle again on Wednesday, 21 March for a place in the last four at Hampden Park.
The visitors had a strong claim for a penalty early on when Steven Thompson chased and harried the Hearts defenders to win the ball, before searching out Gary Teale. The veteran's strong effort at goal struck Danny Grainger's hand as he went to block, but referee Stevie O'Reilly waved away the appeals.
Danny Lennon's side had made a whirlwind start and finally made the breakthrough after 27 minutes. Andy Webster fouled Nigel Hasselbaink on the edge of the box after some loose play from Adrian Mrowiec.
St Mirren set-piece specialist Carey needed no second invitation and stepped up to strike a left-footed free-kick through a gap in the Hearts wall and into the net.
The visitors continued to look the livelier side, but Hearts were not a spent force and stunned their opponents with an equaliser after 37 minutes.
Craig Beattie scored Hearts' opening goal and set up the second
Paulo Sergio's side won their first corner of the match and Grainger's pinpoint delivery found Beattie, who guided a header past Craig Samson for his first Hearts goal.
It was now game on, and the Portuguese manager showed his attacking intent by replacing midfielder Mrowiec with St Mirren tormentor-in-chief Skacel, who has a terrific strike record against the Buddies.
Hearts thought they had snatched the advantage in first-half stoppage time when Ian Black's attempted shot found its way to Beattie at the back post, but the former Celtic striker was controversially flagged offside as he squeezed the ball over the line. Television replays suggested he had in fact been onside.
The Tynecastle side did not appear to feel sorry for themselves as they flew out the traps for the second half.
Stephen Elliott's drive from 16 yards stung the palms of Samson and Ryan McGowan forced the St Mirren keeper to parry with his effort on the rebound. The ball found Elliott once again, but he squandered a clear opportunity when he fired wide of the post.
Lennon's side failed to heed the warning signs and paid the price. Beattie found substitute Skacel's head with a cross from the left to beat Samson and seize the advantage.
Hearts were a team transformed and Skacel could have made it 3-1, however he took a touch too many in the penalty area and defender David van Zanten intervened before he could pull the trigger.
They were to rue that missed opportunity as St Mirren conjured up an unlikely leveller and a replay with six minutes remaining.
Hasselbaink and Teale brought out great saves from Jamie MacDonald before the striker sclaffed the ball across goal and Zaliukas' heel diverted the ball past his own goalkeeper.
Full Time The referee signals the end of the game.
Gary Teale is caught offside. Jamie MacDonald restarts play with the free kick.
Booking Paul McGowan receives a yellow card.
The assist for the goal came from Nigel Hasselbaink.
83:35 Goal scored
Goal - Marius Zaliukas - Hearts 2 - 2 St Mirren An unfortunate own goal is conceded by Marius Zaliukas. Hearts 2-2 St Mirren.
The official flags Craig Beattie offside. Craig Samson takes the free kick.
Assist on the goal came from Gary Teale.
83:35 Goal scored
Goal - Nigel Hasselbaink - Hearts 2 - 2 St Mirren Nigel Hasselbaink fires in a goal from inside the six-yard box to the bottom left corner of the goal. Hearts 2-2 St Mirren.
Inswinging corner taken from the right by-line by Graham Carey.
Craig Beattie fouled by Lee Mair, the ref awards a free kick. Andy Webster takes the direct free kick.
Craig Beattie fouled by Hugh Murray, the ref awards a free kick. Andy Webster takes the direct free kick.
Paul McGowan is flagged offside by the assistant referee. Jamie MacDonald takes the free kick.
Mehdi Taouil fouled by Paul McGowan, the ref awards a free kick. Ian Black restarts play with the free kick.
Effort from outside the box by Gary Teale goes wide right of the target.
Unfair challenge on Nigel Hasselbaink by Daniel Grainger results in a free kick. Free kick taken by Jim Goodwin.
Header from deep inside the area by Andy Webster goes harmlessly over the crossbar.
Graham Carey gives away a free kick for an unfair challenge on Stephen Elliott. Ian Black takes the direct free kick.
Andrew Driver takes a long range shot clearing the bar.
Effort on goal by Nigel Hasselbaink from inside the area goes harmlessly over the bar.
The assistant referee flags for offside against Craig Beattie. Free kick taken by Lee Mair.
The referee blows for offside. Marius Zaliukas takes the free kick.
Craig Beattie produces a right-footed shot from inside the area that clears the crossbar.
Free kick awarded for an unfair challenge on David van Zanten by Craig Beattie. Free kick taken by Craig Samson.
Stephen Elliott takes a shot. Jim Goodwin gets a block in.
Substitution (St Mirren) makes a substitution, with Hugh Murray coming on for Kenny McLean.
Foul by Craig Beattie on Jim Goodwin, free kick awarded. Free kick taken by Craig Samson.
Corner taken by Ian Black from the left by-line, clearance made by Steven Thompson.
Free kick awarded for an unfair challenge on Marius Zaliukas by Steven Thompson. Marius Zaliukas restarts play with the free kick.
Assist on the goal came from Craig Beattie.
47:44 Goal scored
Goal - Rudi Skacel - Hearts 2 - 1 St Mirren Rudi Skacel finds the back of the net with a headed goal from close range. Hearts 2-1 St Mirren.
Ryan McGowan takes a shot. Save made by Craig Samson. Effort from deep inside the area by Stephen Elliott misses to the left of the goal.
Stephen Elliott takes a shot. Craig Samson makes a save.
Free kick awarded for a foul by Gary Teale on Ian Black. Direct free kick taken by Jamie MacDonald.
The match restarts for the second half.
45:00 +1:11 Half time
Half Time The players leave the pitch at half time.
The official flags Craig Beattie offside.
Free kick awarded for a foul by Nigel Hasselbaink on Ian Black. Andy Webster takes the direct free kick.
Stephen Elliott produces a right-footed shot from just outside the box that misses to the right of the net.
Substitution Rudi Skacel replaces Adrian Mrowiec.
Daniel Grainger provided the assist for the goal.
36:48 Goal scored
Goal - Craig Beattie - Hearts 1 - 1 St Mirren Craig Beattie grabs a headed goal from close range. Hearts 1-1 St Mirren.
Corner taken by Daniel Grainger from the right by-line,
The assistant referee signals for offside against Nigel Hasselbaink. Free kick taken by Andy Webster.
Paul McGowan takes a shot. Mehdi Taouil gets a block in.
Free kick awarded for a foul by Ian Black on David van Zanten. Jim Goodwin takes the free kick.
Free kick awarded for an unfair challenge on Ian Black by Paul McGowan. Ian Black takes the free kick.
Outswinging corner taken from the right by-line by Graham Carey, Headed effort from deep inside the area by Lee Mair misses to the right of the goal.
Kenny McLean takes a shot. Ian Black gets a block in.
Gary Teale takes a outswinging corner from the right by-line played to the near post, save by Jamie MacDonald.
The assist for the goal came from Nigel Hasselbaink.
26:01 Goal scored
Goal - Graham Carey - Hearts 0 - 1 St Mirren Free kick scored by Graham Carey from outside the penalty area to the bottom right corner of the goal. Hearts 0-1 St Mirren.
Free kick awarded for an unfair challenge on Nigel Hasselbaink by Andy Webster.
Nigel Hasselbaink is flagged offside by the assistant referee. Jamie MacDonald restarts play with the free kick.
Foul by Andy Webster on Steven Thompson, free kick awarded. Graham Carey shoots direct from the free kick.
Craig Beattie is flagged offside by the assistant referee. Jim Goodwin takes the indirect free kick.
Shot from just outside the box by Paul McGowan misses to the right of the goal.
Andrew Driver takes a shot. Save by Craig Samson.
The referee blows for offside against Steven Thompson. Jamie MacDonald restarts play with the free kick.
Headed effort from deep inside the area by Craig Beattie misses to the left of the goal.
Unfair challenge on Gary Teale by Daniel Grainger results in a free kick. Free kick taken by David van Zanten.
Nigel Hasselbaink takes a shot. Blocked by Mehdi Taouil. Graham Carey takes the outswinging corner, Steven Thompson has a headed effort at goal from deep inside the area missing to the right of the target.
Shot by Paul McGowan from deep inside the penalty area misses to the right of the goal.
Paul McGowan takes a shot. Blocked by Adrian Mrowiec.
Steven Thompson takes a shot. Save made by Jamie MacDonald.
Adrian Mrowiec concedes a free kick for a foul on Graham Carey. Craig Samson takes the free kick.
Free kick awarded for a foul by Steven Thompson on Daniel Grainger. Free kick taken by Jamie MacDonald.
Unfair challenge on Kenny McLean by Adrian Mrowiec results in a free kick. Direct free kick taken by Lee Mair.
The match begins.
Live text and data provided by The Press Association
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.