Veteran Kumar Sangakkara hit a 200-plus score for the 10th time to light up the fourth day's play in the first Test between Sri Lanka and Pakistan in Galle on Saturday.
The prolific left-hander made 221 as the hosts declared their first innings at 533-9 shortly before stumps, a lead of 82 runs over Pakistan's total of 451.
Left-arm spinner Rangana Herath then had opener Khurram Manzoor caught behind for three to reduce the tourists to 4-1 in six overs before the close.
Ahmed Shehzad was on one and nightwatchman Saeed Ajmal had yet to score when stumps were drawn, leaving Pakistan the task of batting out the final day to draw the opening encounter of the two-match series.
Sangakkara, second only behind Australian legend Don Bradman's tally of 12 scores of more than 200, took advantage of the easy-paced wicket to toy with the Pakistan attack for nearly 12 hours.
He fell in the post-tea session, stumped off spinner Abdur Rehman trying to pick up the scoring rate in the company of tail-enders.
"I think everyone is second to the Don," he said. "I am pretty happy that I am two double-hundreds behind him because that is probably the only way I can even get close to reaching him.
"It was quite a bit of hard work out there, and also a little bit of luck. But this game is not over yet. We need to get nine wickets. Our responsibility will be to make the batsman play as much as we can."
Pakistan's frontline off-spinner Ajmal, who went wicketless for 46 overs, grabbed five on either side of tea to finish with expensive figures of five for 166 from 59.1 overs.
"Sangakkara played very well, but the story would have been different if some catches had been taken or some decisions had favoured us," said Ajmal.
"We are confident that we will not lose this match, but we have to see how the first session goes tomorrow (Sunday)."
Sangakkara dropped on first ball
Pakistan paid heavily for letting Sangakkara escape off the first ball of the day when Rehman spilled a chance at point off left-arm seamer Junaid Khan.
Junaid struck three deliveries later as Mahela Jayawardene was adjudged leg-before through the Decision Review System (DRS).
Umpire Ian Gould turned down a loud shout from the bowler, but Pakistan earned a positive verdict after appealing for a review from the TV official. Replays showed the ball hitting the top of the off-stump.
Jaywardene, who is due to quit Test cricket after the series ends in Colombo later this month, made 59 in a third-wicket stand of 113 with Sangakkara.
The 36-year-old Sangakkara had on Friday risen to fourth place in the list of century-makers with his 37th hundred, the seventh three-figure knock in his last 14 Tests.
Only the retired trio of India's Sachin Tendulkar, with 51 centuries, Jacques Kallis of South Africa, who had 45, and Ricky Ponting of Australia on 41, have scored more hundreds.
Skipper Angelo Mathews hit 91 during a fourth-wicket stand of 181 with Sangakkara before he was caught in the slips off Ajmal just before tea.
The Sri Lankan captain has been dismissed in the 90s on five occasions - thrice on 91 against Pakistan since last December.
The second and final Test will be played on Jayawardene's home ground at the Sinhalese Sports Club in Colombo from August 14.