Dimuth Karunaratne's brilliant 196 was the mainstay of Sri Lanka's score, while 50s from Dinesh Chandimal, Niroshan Dickwella and Dilruwan Perera boosted the tally.
Pakistan trail by 1-0 in the series after they lost the first Test by 21 runs in Abu Dhabi.
Pakistan will hope for more life in the pitch as they seek to secure a share of the spoils in the two-match series. After all their struggles at home against India - plunging to record whitewashes - which led to resignations of their selectors, then losing Angelo Mathews to injury; to come back from all that and beat Pakistan at a venue they have never lost in, it was incredible. Pakistan had begun the day at 61 for no loss, but soon haemhorrhaged four wickets for 48 runs, putting Sri Lanka in control of the Test - or so it was thought. He defused Yasir Shah judiciously again, routinely getting inside the line of the ball to work him towards square leg. Australia's Charlie Turner and Englishman Alec Bedser had six consecutive five-fours - but all three were fast bowlers.More news: Liverpool star helps Germany qualify for 2018 World Cup
More news: Las Vegas gunman's girlfriend returns to United States for questioning
More news: 1 seat after beating Ostapenko
But for all the substance Karunaratne's innings had provided, it was Sri Lanka's lower middle-order men whose enterprise gained their team the most ground on day two.
These all are some terms of the Pakistan vs Sri Lanka match which is maintain its stranglehold. Ironically, video replay showed the ball missing the stumps.
Karunaratne plays a shot during the second day. To add to Pakistan´s woes pace spearhead Mohammad Amir walked off the field after a recurring shin injury sustained late on Friday. "Amir will not bowl in the ongoing Test match at the Dubai Cricket Stadium but would be available to bat". Karunaratne appeared exhausted after facing 405 balls and hitting 19 boundaries and a six.
Where to watch second Test match? But this being a Pakistan-Sri Lanka Test, things rarely go that smoothly for an ascendant team. Sami Aslam and Shan Masood are still in field for the team. Six teams have tried beforehand, and six teams have failed, Sri Lanka also failed to perform.