St Johnstone battled back to claim a Scottish Cup fifth-round replay against top flight rivals Hearts.
David Templeton beat Peter Enckelman at his near post to give the home side a 10th-minute lead.
St Johnstone captain Dave MacKay was sent off on 74 minutes after picking up two bookings.
However, the visitors managed to find an equaliser when Cillian Sheridan beat the offside trap and tucked home three minutes later.
The two sides will meet again at McDiarmid Park on 14 February.
Hearts were lively from the off and made the breakthrough when Templeton cut in from the left and dispatched a low shot past Enckelman.
Saints probed in search of an equaliser but Francisco Sandaza took a fresh-air swipe at David Robertson's cross.
Templeton almost created a second for his side with a burst into the box but Scott Robinson mis-hit his shot.
Sandaza headed against the crossbar from substitute Sheridan's cross early in the second half.
Sheridan (left) levelled for St Johnstone
Hearts then claimed unsuccessfully for a handball against MacKay in the St Johnstone box.
David McCracken headed over and Liam Craig drew a save from Jamie MacDonald as the Hearts goal came under continued pressure.
At the other end, Stephen Elliott could not get enough purchase on his header after meeting Templeton's lofted cross.
St Johnstone's chances suffered a blow when MacKay's high boot connected with Templeton and the defender was punished with a second yellow and subsequent red card.
Moments later, Sandaza got in behind the Hearts defence but his downward volley lacked power and MacDonald gathered.
But Sheridan, who had replaced Robertson, was more successful in front of goal after running on to Sandaza's pass and placing the ball round MacDonald as the keeper came off his line.
A weaving run and shot by Templeton was claimed at the second attempt by Enckelman as the action became frantic in the closing stages.
But there to be no more goals before close of play.
Heart of Midlothian 30 MacDonald 06 Webster 17 McGowan 26 Zaliukas 02 Hamill Booked 08 Black Booked 12 Templeton (Driver - 90' ) 19 Skacel (Taouil - 76' ) 31 Mrowiec 10 Elliott 27 Robinson Substitutes 28 Ridgers 05 Barr 11 Driver 21 Taouil 23 Glen St Johnstone 01 Enckelman 02 MacKay Dismissed after an earlier booking 03 Davidson 06 Anderson 18 McCracken 04 Morris 08 Davidson Booked (Millar - 78' ) 09 Croft Booked (Keatings - 84' ) 10 Craig 16 Robertson Booked (Sheridan - 45' ) 21 Sandaza Substitutes 15 Mannus 07 Millar 11 Sheridan 22 Oyenuga 46 Keatings
Ref: Craig Thomson