Experienced batsman Azhar Ali and Asad Shafiq steadied Pakistan’s innings after Sri Lanka took two quick wickets on the third day of the first Test in Abu Dhabi on Saturday.
Ali, who completed 5,000 Test runs when on 32, was on 37 while Shafiq was unbeaten on 38 as Pakistan still trail the Sri Lankan first innings total of 419 by 225 runs.
Openers Shan Masood and Sami Aslam set the platform for a big total by putting together a solid 114-run opening stand after they resumed at 64 without loss.
But Sri Lanka hit back by removing both openers in the space of two runs.
Aslam, recalled after being dropped from the West Indies tour on disciplinary grounds earlier this year, was trapped leg-before by off-break bowler Perera. He hit four boundaries in his seventh Test half century.
Two runs later Masood attempted a sweep shot off the wily Herath but missed the ball and was bowled round his legs.
Both Ali and Shafiq survived confident appeals. Ali wisely reviewed a leg-before decision off Perera, but the ball hit his bat before the pad.
Shafiq was given not out on a review when he was stumped off Herath on one.
Ali became the eight Pakistani batsman to score 5,000 or more runs, reaching the milestone in 61st Test.