See the state of play on the final day in Sharjah.
Pakistan were set a daunting target of 302 in 59 overs to win the third and final Test and level the series against Sri Lanka in Sharjah on Monday.
Sri Lanka were bowled out for 214 in their second innings, with left-arm spinner Abdul Rehman finishing with 4-56 and off-spinner Saeed Ajmal taking 3-53, but not before their batsmen had kept Pakistan at bay on the morning of the fifth and final day.
Prasanna Jayawardene made 49 and held on almost to the end, forcing a 15-minute delay in the lunch break.
Sri Lanka batted positively to add a quick 56 runs in the first hour with Angelo Mathews (31) and Prasanna negotiating the pace-cum spin attack without problems, raising hopes of a declaration after lunch.
But Mohammad Talha gave Pakistan their much needed breakthrough when he had Mathews caught off a miscued hook after he had added 62 for the sixth wicket with Prasanna.
Rehman then grabbed two quick wickets to put the brakes on Sri Lanka, having Dilruwan Perera caught at short-leg for eight before removing Rangana Herath for a first-ball duck.
Herath recorded a golden pair in the match as he was also dismissed first ball in the first innings.
Prasanna hit six boundaries in his 88-ball knock before he was dismissed by Ajmal, who also removed Shaminda Eranga to wrap up the innings.
Pakistan paid the price for dropping two crucial catches in the last hour on Sunday, with Mathews let off on 11 by Khurram Manzoor and Prasanna dropped by wicketkeeper Sarfraz Ahmed on nought.
Sri Lanka also carried an invaluable 87-run lead over from the first innings.
Pakistan will have to score at more than five an hour to level the series after losing the second Test in Dubai by nine wickets. The first Test in Abu Dhabi ended in a draw.
On the fifth day of the third and final Test between Pakistan and Sri Lanka played at Sharjah Stadium on Monday:
Sri Lanka 1st innings 428-9 dec (D. Perera 95, A. Mathews 91, K. Sangakkara 52; Junaid Khan 3-81, Mohammad Talha 3-99)
Pakistan 1st innings 341 (Ahmed Shehzad 147, Misbah-ul Haq 63, Khurram Shehzad 52; R. Herath 5-125, S. Eranga 4-60)
Sri Lanka 2nd innings (overnight 133-5)
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 c Manzoor b Talha 31
P. Jayawardene c Ali b Ajmal 49
D. Perera c Ali b Rehman 8
R. Herath c Younis b Rehman 0
S. Eranga c Rehman b Ajmal 3
S. Lakmal not out 2
Extras: (b2, lb4 nb2, w2) 10
Total: (all out; 101.4 overs) 214
Fall of wickets: 1-13 (Karunaratne), 2-37 (Sangakkara), 3-66 (Silva), 4-89 (Chandimal), 5-127 (Jayawardene), 6-189 (Mathews), 7-203 (Perera), 8-203 (Herath), 9-209 (Prasanna)
Bowling: Junaid 20-6-34-0 (1w), Talha 23-2-65-3 (2nb, 1w), Rehman 33-10-56-4, Ajmal 25.4-7-53-3
Toss: Sri Lanka
Umpires: Richard Kettleborough (ENG) and Sundaram Ravi (IND)
Tv umpire: Bruce Oxenford (AUS)
Match referee: Javagal Srinath (IND)