Kumar Sangakkara smashed his 10th double century as Sri Lanka declared its first-innings at 533-9 for an overall lead of 82 runs on the fourth day of the first Test.
Pakistan lost opener Khurram Manzoor to left-arm spinner Rangana Herath to finish the day on 4-1, still trailing by 78 runs.
Pakistan first innings 451
Sri Lanka first innings 533-9d
Pakistan second innings
K Manzoor c Dickwella b Herath 3
A Shehzad not out 1
S Ajmal not out 0
Total (1 wicket) 4
Fall of wickets: 1-3
Sangakkara's imperious 221 in just over 11 hours off 425 balls was studded with 24 fours as the master batsman made Pakistan pay heavily for dropping him off Saturday's very first ball and later on 168.
Abdul Rehman, who missed a first-ball sitter of Sangakkara, had the left-hander finally stumped late in the last session before Pakistan's tough time in the field ended when the declaration came.
Angelo Mathews made a splendid 91 and fell to offspinner Saeed Ajmal (5-166), who finished with a late five-wicket haul after taking his first wicket of the Sri Lankan captain in his 47th over.
Sangakkara raised his 200 off 398 balls with 21 fours when he punched Ajmal to point after tea for a single and is now just two behind Don Bradman's all-time record of 12 double centuries.
Pakistan's bowlers got little support from their fielders on a placid wicket as Sangakkara shared three century-stands in home team's solid response to Pakistan's 451.
He crafted 181 runs with Mathews as Pakistan could only get the wicket of Mahela Jayawardene (59) in Junaid Khan's eventful first over with the new ball in the first session.
Jayawardene, playing his last series before retiring after the second Test, was beaten by his first delivery and got an edged boundary through slips off the next ball before falling to Khan's immaculate delivery that jagged back into the batsman.
Sangakkara got a second chance in his marathon knock, which began on the second day, when Younis Khan spilled a chance in lone slip just before the offspinner removed Mathews.
Ajmal then wrapped up the tailenders but Dilruwan Perera added a rapid 31 before he was stumped and Mathews declared the innings.