Rangana Herath bowled Sri Lanka to a stunning 21-run win over Pakistan overight, snaring six wickets on the last day of the series-opening test and becoming the first left-arm spinner to claim 400 wickets in cricket's traditional format.
The 39-year-old orthodox spinner snared 6-41 in the second innings - giving him 11 for the match - as Sri Lanka defended its meager 135-run advantage on a dramatic day when 16 wickets tumbled in three sessions.
Sri Lanka resumed at 69-4 on the fifth morning and was bowled out for 138, setting Pakistan a target of 136 for victory.
Pakistan's chase started badly, losing wickets at 4, 7, 16 and 32 before limping to tea at 67-5, setting up a tense last session.
Skipper Sarfraz Ahmed shared an innings-reviving 42-run stand with Haris Sohail but when he was stumped, advancing down the wicket to Herath, Pakistan slumped to 78-6 and Sri Lanka had the upper hand.
Sohail, who scored a defiant 76 and was the last man out in Pakistan's first innings of 422, kept his team's hopes alive until he was trapped lbw with a ball from Dilruwan Perera that hit the back leg. He grafted for 34 runs from 69 deliveries and his dismissal left Pakistan needing 38 runs with three wickets in hand.
Herath ensured it for the visitors when he bowled Hassan Ali (8) and Mohammad Amir (9) and had Mohammad Abbas out lbw to skittle Pakistan for 114.
In the process, he lifted his career tally to 101 test wickets against Pakistan and 400 overall.
Herath noted there was assistance from the pitch late in the match, but he was feeling sore after a marathon bowling spell.
But his overwhelming feeling was pride.
"I was so happy with the remarkable achievement," of 400 wickets, Herath was quoted as saying. "All credit should go to the people behind me, from my parents to the team and the supporting staff."
It was Pakistan's first test defeat in Abu Dhabi, one of the team's homes away from home while international cricket is suspended in their country.
Dinesh Chandimal's unbeaten 155 helped Sri Lanka to a first innings of 419, with key contributions from Dimuth Karunaratne (93) and Niroshan Dickwella (83). Bat continued to dominate ball in Pakistan's reply, with the top three batsmen posting half centuries and Sohail adding his valuable 76 to give his team a three-run first-innings margin.
As the wicket deteriorated, though, the spin bowlers started to assert themselves and Yasir Shah's 5-51 contained Sri Lanka's second innings and seemingly put Pakistan in command - with Dickwella's unbeaten 40 helping the visitors mount a rear-guard and eventually match-winning lower-order rally from 101-8 to 138 all out.
"Dickwella was unbelievable in the second innings, he got us to (almost) 140," Chandimal said. "We knew once we got that much, we have our legend (Herath) here.
"We knew if there were a couple of early wickets, we would do well. Credit to the bowlers who put (in) their heart and soul."
Sarfraz said his Pakistani team was bitterly disappointed after feeling they should have won.
"We have a few issues, especially in the fifth day when we come under pressure," he said. "Some things have to change - we needed a partnership and didn't get one.
"We'll try and bounce back in the next game."
The second test starts Friday in Dubai.