Pakistan captain Babar Azam scored 196 and Mohammad Rizwan 104* to force a dramatic draw in the second Test against Australia in Karachi.
The pair put the home team well on course for a draw, but spinner Nathan Lyon turned the match on its head by dismissing Azam and Faheem Ashraf with successive deliveries.
Lyon came on to bowl the third of the 15 mandatory remaining overs of the match and, with his fourth delivery, had Azam glove a catch to Marnus Labuschagne at forward short leg.
Next ball Lyon had Ashraf caught at slip to raise hopes of an Australian win.
In the late-hour drama, Usman Khawaja also dropped Rizwan on 91 off luckless spinner Mitchell Swepson with 18 balls left in the match.
The pugnacious Rizwan, in company of tailender Nauman Ali (nought), batted out 46 balls during their 29-run stand for the eighth wicket to keep the three-match series tied at 0-0.
Third and final Test will start in Lahore from Monday.
Azam’s score become the best-ever fourth innings by a captain, surpassing Mike Atherton’s 185 for England against South Africa in 1995.
His score is also the highest fourth-innings individual total by a Pakistani, erasing the 171* Younis Khan made against Sri Lanka in Pallekele in 2015.
The Pakistan skipper added an invaluable 228 runs for the third wicket with Abdullah Shafique (96) and another 115 for the fifth with Rizwan, keeping Australia’s spin-cum-pace attack at bay.
Rizwan hit 11 boundaries and a six.
With Pakistan falling 63 short of the 506-run target, the record for the highest chase in all Test cricket remains with the West Indies, who scored 418 against Australia at Antigua in 2003.
Azam’s knock frustrated Australia and their skipper Pat Cummins, who dismissed Shafique and Fawad Alam (nine) in the first two sessions to raise hopes of a win.
But Australia were themselves to blame for not dislodging Azam as Travis Head and then Labuschagne dropped sharp catches off Swepson off successive deliveries with the batsman on 161.
Azam also survived a confident lbw appeal against Lyon when on 157, but it turned out to be umpire Aleem Dar’s call on review.
Lyon was the best Australia bowler with 4-112 off a marathon 55 overs.
Earlier, Cummins struck eight minutes before lunch to end an epic third-wicket stand with the score on 249.
Shafique, who hit 136* in the first Test, drove Cummins for a boundary to reach 96.
But, in his next over, the Australian fast bowler drew the right-hander into another drive which this time found the edge.
Smith held a sharp catch in the slips, making amends for dropping the same batsman, on 20, from a more straightforward chance at slip off Cummins the day before.
© Agence France-Presse