Kumar Sangakkara hit a fighting hundred but Pakistan still captured three key wickets in the second session to press for victory in the first Test against Sri Lanka in Abu Dhabi on Friday.
The left-handed batsman was unbeaten on 113 as Sri Lanka, trailing by 314 runs on the first innings, reached 212-4 in their second outing at tea on the fourth day at Abu Dhabi stadium.
They still need 102 runs to avoid an innings defeat. Angelo Mathews was the other not out batsman on 10.
Sangakkara's 26th Test hundred had frustrated Pakistan in the morning session as the former Sri Lankan captain added an invaluable 153 runs for the second wicket with Lahiru Thirimanne (68) to reach lunch at 125-1.
Sri Lanka had lost opener Tharanga Paranavitana off the very first ball of their second innings on Thursday, but Sangakkara and Thirimanne took the fight to the Pakistani bowlers.
Pakistan then hit back by dismissing Thirimanne soon after lunch, run out after the opener, taking a second run but failed to beat a throw from the fine-leg by Azhar Ali.
Seven runs later, Mahela Jayawardene (four) then played on to off-spinner Saeed Ajmal before paceman Junaid Khan bowled skipper Tillakaratne Dilshan through the gate for nine, leaving Sri Lanka at 191-4.
Despite the wickets fall, Sangakkara kept his cool, hitting Khan for his 11th boundary to reach three-figure mark, his sixth against Pakistan. He has so far hit 12 boundaries.
Pakistan had their chances in the morning session but they spurned as many as five catches, three of Thirimanne which helped the opener to post his maiden half-century.
Khan, who destroyed Sri Lanka with 5-38 in their first innings of 197, was the unlukcy bowler on three occasions as Mohammad Hafeez grassed two regulation catches in the slip off Thirimanne when he was on 40.
Much to Khan's disappointment Younis Khan held a sharp edge off Sangakkara but the catch was disallowed by the umpires as the ball had bounced before getting into the hands of the slip fielder.
Thirimanne again escaped when Hafeez failed to catch a sharp cut when the left-handed opener was on 57.
Sangakkara was the fist to get to his fifty, when he took a single off the luckless Khan, while Thirimanne reached his maiden fifty with a single off Saeed Ajmal. He has so far hit four boundaries.
Pakistan again let off Sangakkara when Younis failed to hold onto a sharp edge when a Saeed Ajmal's delivery surprised the left-handed batsman batting on 56.