Skipper Babar Azam produced a career-best 196 under immense pressure as Pakistan snatched draw from the jaws of defeat in the second Test against Australia on Wednesday.
Chasing a record 506 for an improbable win, Pakistan's best bet was to bat out the final day and Babar led by example as they finished on 443-7, the sixth highest fourth innings total of all time.
Babar's majestic knock, which included 21 fours and a six, will be an inspiration for his team heading into the third and final Test in Lahore on Monday.
The hosts were on the back foot after folding for 148 in reply to Australia's massive first innings total of 556-9 at the National Stadium.
The record victory target was never within Pakistan's reach but Babar's marathon 228-run partnership with opener Abdullah Shafique (96) kept them afloat in the conTest.
Nathan Lyon (4-112) injected fresh drama in the final session dismissing Babar and Faheem Ashraf with successive deliveries but Mohammad Rizwan's unbeaten 104 helped Pakistan salvage a draw.
The opening Test in Rawalpindi had also ended in a draw.
Earlier, Australia began the final day needing eight wickets to go 1-0 up in the three-Test series.
Pakistan, on the other hand, required 314 runs in 90 overs to pull off Test cricket's greatest chase or, alternatively, bat out three sessions to force a draw.
A burgeoning third wicket stand between Babar Azam and Abdullah Shafique had kept Pakistan in the contest and the duo continued to frustrate Australia when play resumed.
Mitchell Starc and Pat Cummins could not make early inroads with the new ball and Babar greeted Mitchell Swepson with back-to-back fours when the leg spinner was introduced into the attack.
Abdullah and Babar batted together for nearly 87 overs in a spectacular rear-guard before Cummins broke the 228-run stand in the penultimate over before lunch.
The Australia captain induced Abdullah into a drive and Steve Smith, who had dropped the opener on 20 on Tuesday, took a waist-high catch at slip to complete the dismissal.
Abdullah hit six fours and a six during his 305-ball vigil.
Cummins struck again after lunch when he removed Fawad Alam caught behind for nine.
Babar duly completed 150, his first in Test cricket, and the celebration was muted considering the task at hand.