Dubai - A watchful first Test century for Azhar Ali took Pakistan to 281 for four at the close on the second day of the second Test on Thursday and sent them past Sri Lanka's first innings total of 239.
Azhar endured a torrid time in the "nervous nineties", thrashing his bat in frustration on several occasions after failing to capitalise on loose deliveries, but eventually he reached the milestone from 229 balls.
The 26-year-old faced a further 13 balls without adding to his 100 runs and was unluckily dismissed lbw off the slow bowling of captain Tillakaratne Dilshan despite a bottom edge onto his pads.
Captain Misbah-ul-Haq provided able support in their 94-run stand, notching up an unbeaten 40 to leave Pakistan 42 runs ahead of their Asian rivals after cautiously adding 239 runs from 90 overs to their overnight score of 42 without loss.
Pakistan, hosting the three-Test series in the Gulf region due to security concerns at home, had also dominated the opening day's play to dismiss Sri Lanka relatively cheaply on Wednesday.
Early on Thursday Sri Lanka medium pacer Dhammika Prasad removed the Pakistan openers in quick succession, first sending a full delivery across Taufeeq Umar (27) who could only edge behind to give debutant wicketkeeper Kaushal Silva his first catch in Test cricket.
Two overs later, Prasad struck again when he removed Mohammad Hafeez lbw for 33 when the right-hander misjudged a sharp delivery that came back from outside off and rapped his pads in front of the stumps.
Azhar added 117 for the third wicket with Younis Khan (55), who edged onto his stumps shortly before the tea interval at the Dubai International Stadium.
The former captain had looked untroubled, bringing up his 50 by hoisting Dilshan over the rope for six, however the spinner had the last laugh when he dismissed Younis a short while later.
Sri Lanka battled to earn a draw in last week's first Test in Abu Dhabi while the third and final match of the series will be played in Sharjah from November 3.
While the match was going on, jurors in London retired to consider their verdict in the match-fixing trial of Pakistan cricketers Salman Butt and Mohammad Asif, who are accused of plotting to bowl deliberate no-balls against England last year.