Sri Lanka lost early wickets in their second innings but extended their lead to 220 runs over Pakistan in the third and final Test in Sharjah to boost their chances of a series victory.
Spinner Abdur Rehman and paceman Mohammad Talha picked up two wickets apiece to reduce Sri Lanka to 89 for four but experienced Mahela Jayawardene (46) and captain Angelo Mathews (14 not out) thwarted Pakistan with a stand of 38 runs.
At stumps on the penultimate day of the series, Sri Lanka reached 133 runs for five wickets to add to their first-innings lead of 87.
Jayawardene, who made 129 in his team's nine-wicket win in Dubai in the second Test, became the first Sri Lankan to cross 11,000 Test runs and eighth batsman overall during his innings.
His careful knock came to an end when his bat-pad catch off Saeed Ajmal was smartly taken by Azhar Ali at short leg.
Left-arm spinner Rehman extracted good turn from the pitch and picked up the wickets of opener Kaushal Silva (36) and Kumar Sangakkara (eight) while Talha dismissed Dimuth Karunaratne (eight) and Dinesh Chandimal (13).
Khurram Manzoor did not help Pakistan's cause by dropping an easy chance from Mathews at cover off fast bowler Junaid Khan with the batsman on nine.
Wicketkeeper Sarfraz Ahmed also dropped a sharp chance from Prasanna Jayawardene (six not out) off Ajmal before the batsman had opened his account.
Earlier in the morning, Rangana Herath picked up his 17th five-wicket haul in Tests for Sri Lanka as Pakistan were bowled out for 341.
Fast bowler Shaminda Eranga picked up the first two wickets to fall to take his innings tally to four as Pakistan went for quick runs to wipe off the deficit.
Pakistan captain Misbah-ul-Haq hit three sixes and a four in his knock of 63 before being caught at long-on trying to clear Herath over the ropes.
Junaid also struck two sixes to reduce the fist-innings deficit before he too was caught in the deep off Herath.
Sri Lanka 1st innings: 428 for nine dec
Pakistan 1st innings (overnight 291 for 6)
Khurram Manzoor c Prasanna b Eranga 52
Ahmed Shehzad b Herath 147
Azhar Ali c Mathews b Perera 8
Younis Khan c Prasanna b Herath 17
Misbah-ul Haq c Chandimal b Herath 63
Asad Shafiq lbw b Eranga 18
Sarfraz Ahmed c Prasanna b Herath 5
Abdul Rehman c Prasanna b Eranga 2
Mohammad Talha lbw b Eranga 2
Saeed Ajmal not out 0
Junaid Khan c Chandimal b Herath 16
Extras: (B-3, LB-6, NB-1, W-1) 11
Total: (all out; 109.1 overs) 341
Fall of wickets: 1-114, 2-149, 3-189, 4-245, 5-274, 6-291, 7-294, 8-300, 9-325.
Bowling: Herath 38.1-8-125-5, Lakmal 23-4-61-0, Perera 17-1-71-1, Eranga 24-5-60-4, Mathews 7-3-15-0.
Sri Lanka 2nd innings:
D Karunaratne b Talha 8
K Silva b Rehman 36
K Sangakkara c Manzoor b Rehman 8
M Jayawardene c Ali b Ajmal 46
D Chandimal b Talha 13
A Mathews not out 14
P Jayawardene not out 6
Extras: (NB-1, W-1) 2
Total: (For five wkts; 71 overs) 133
Fall of wickets: 1-13, 2-37, 3-66, 4-89, 5-127.
Bowling: Junaid 15-5-25-0, Talha 16-2-36-2, Rehman 22-7-36-2, Ajmal 18-5-36-1.
Image: Rangana Herath
Photograph: Tom Shaw/Getty Images