Asad Shafiq and Sarfraz Ahmed put on an unbroken partnership of 149 to haul Pakistan back into contention in their day/night second Test against Sri Lanka on Monday.
Pakistan were staring at a 2-0 series defeat after they lost their opening five wickets for just 52 runs on day four at the Dubai International Cricket Stadium.
Sri Lankan spinner Dilruwan Perera claimed three wickets inside 10 deliveries of the twilight session to put the visitors in the box seat.
First he dismissed Haris Sohail for 10, before taking the wicket of opener Shan Masood (21) and then Mohammad Azam for a duck, two balls later.
But Shafiq (86no) and captain Ahmed (57no) got Pakistan's second innings back on track in the night session with a fantastic partnership to leave the hosts requiring just 119 runs to square the series.