Sri Lanka became the first team to beat Pakistan in a Test series in the UAE after a 68-run victory in the second Test in Dubai for a two-nil series win.
Pakistan came into the final day needing another 119 runs to win but only had five wickets in the bank although they had Asad Shafiq (86*) and captain Sarfraz Ahmed (57*) at the crease in a partnership that was worth 146.
The duo pushed their stand past the 150 mark with Shafiq going to his 11th Test century as the 317-run target came closer.
However, with 92 runs still needed Sri Lanka off-spinner Dilruwan Perera broke the 173-run stand when he had the Pakistan skipper caught at deep square-leg for 68.
Perera then struck again – to claim his fourth five-wicket haul in his 22nd Test – not long after as Mohammad Amir was trapped in front for four as Sri Lanka closed in on a morale-boosting series win.
It was fell away pretty quickly after that as Yasir Shah (5) was stumped by Niroshan Dickwella off the bowling of left-arm spinner Rangana Herath before the win was confirmed as Shafiq edged seamer Suranga Lakmal to the slips to be out for 112.
It was Herath who got the final wicket as Wahab Riaz (1) top-edged to give Sri Lanka captain Dinesh Chandimal the chance to take the wining catch.
Perera finished with figures of 5-98 in 26 overs while Herath took 2-57 in 22.2 overs.
Sri Lanka were put on the front foot in the game when they amassed 482 in the first innings – thanks mainly to 196 from opener Dimuth Karunaratne – before bowling Pakistan out for just 262.
Pakistan fought back to dismiss their opponents for just 96 to set up an intriguing fourth innings but Sri Lanka built on their 21-run win on Abu Dhabi in the first Test.