Mohammad Hafeez overcame his lean start to the tour of Sri Lanka by carving out a career best 172 not out as Pakistan reached an impressive 334 for one wicket at close of play on the first day of the second test on Saturday.
Hafeez, who started off on a cautious note with only 20 runs in the morning, shifted gears in the afternoon to score 80 off 86 balls and reach his century with 12 fours.
By the close he had hit 18 fours and one six in his 281-balls innings.
The opener had managed only 105 runs, with a top score of 37, in his nine previous innings for Pakistan, who trail the three-match series 1-0.
Azhar Ali (92 not out) kept Hafeez company, the duo having added 256 runs for the unbroken second wicket after batting through the final two sessions.
Sri Lanka thought they had dismissed Hafeez on 101 in the over before the tea break when the batsman gloved a short delivery from seamer Angelo Mathews to wicketkeeper Prasanna Jayawardene while attempting a pull shot.
But umpire Ian Gould ruled it as a no-ball after consulting with the TV umpire.
Hafeez also survived a scare on 65 when he lofted off-spinner Suraj Randiv to long off where Nuwan Kulasekera ran back, got both hands to the ball but failed to hold on to the catch.
Hafeez again rode his luck when, at 171 he edged a catch to Prasanna Jayawardene off Herath. Umpire Simon Taufel overruled the appeal although television replays showed an edge.
Earlier, opener Taufeeq Umar (65) hit an aggressive half-century and took the attack to the bowlers after Pakistan were put in to bat on a pitch which offered some help for the seamers.
The left-hander raced away to his half-century off 62 balls with the aid of eight fours and looked good for a hundred before he was out caught behind.
Umar attempted to cut Mathews but clipped a fine edge to wicketkeeper Jayawardene, who was standing up to the stumps.