Pakistan pulled off a historic run chase as the third Test ended in a thrilling finish at the Sharjah Cricket Stadium.
Set 302 for victory, Pakistan reached their target with nine balls to spare to complete a five-wicket win and tie the three-match series 1-1.
It was the 10th highest successful fourth innings run chase in the history of Test cricket.
|Pakistan 2nd Innings: 302-5 (57.3 overs)|
|Manzoor||c P Jayawardene||b Lakmal||21||39||27|
|Shehzad||c Karunaratne||b Lakmal||21||28||20|
|Azhar Ali||c P Jayawardene||b Lakmal||103||240||137|
|Y Khan||c Sangakkara||b Mathews||29||57||42|
|Sarfraz Ahmed||c P Jayawardene||b Eranga||48||66||46|
|Extras||1nb 3w 6b 1lb||11|
Sri Lanka began the fifth and final day with a lead of 220 but lost their final five wickets for just 81 in the morning session.
They were bowled out for 214 in their second innings, with captain Angelo Mathews the first to fall for 31, caught by Khurram Manzoor at deep square leg off Mohammad Talha.
Abdur Rehman then removed Dilruwan Perera and Rangana Herath in consecutive balls before Saeed Ajmal wrapped up the innings.
He picked up the key wicket of wicketkeeper Prasanna Jayawardene for 49 before removing Shaminda Eranga.
|Sri Lanka 2nd Innings: 214 all out (101.4 overs)|
|Sangakkara||c Manzoor||b Rehman||8||53||30|
|M Jayawardene||c Azhar Ali||b Ajmal||46||211||144|
|Mathews||c Manzoor||b Talha||31||191||128|
|P Jayawardene||c Azhar Ali||b Ajmal||49||115||88|
|Perera||c Azhar Ali||b Rehman||8||32||22|
|Herath||c Y Khan||b Rehman||0||1|
|Eranga||c Rehman||b Ajmal||3||36||32|
|Extras||2nb 2w 2b 4lb||10|
It left Pakistan needing 302 off 59 overs.
Openers Khurram Manzoor and Ahmed Shehzad took up the challenge with a stand of 35 at almost a run a ball, but Suranga Lakmal removed both in quick succession to leave Pakistan on 48-2.
Key man Younis Khan went for 29 when he pulled Mathews straight to Kumar Sangakkara at mid-wicket, but Pakistan promoted wicketkeeper Sarfraz Ahmed up the order.
He blasted 48 off 46 balls before being caught behind off Eranga in the 37th over. Pakistan were 186-4 and in touch with the run rate required.
Azhar Ali was anchoring the innings. Together with captain Misbah-ul-Haq, he took Pakistan to 224-4 at drinks, leaving them needing 78 off the final 15 overs.
With Sri Lanka delaying the over rate and complaining about bad light, Azhar completed his fifth Test century off 133 balls.
Pakistan were within seven runs of their victory when Azhar was caught behind off Lakmal for 103.
However, Misbah scampered through for a quick single to finish unbeaten on 68 and lead his side to a famous victory.