Sri Lanka fought Pakistan and rain for a 246-run victory and a split in their two-match test series on Thursday.
Set an improbable target of 508 runs to win, Pakistan was bowled out for 261 with a session to spare in its second innings on Day 5 at the Galle International Stadium.
After bad light and rain ended play early the past two days, Sri Lanka's bowlers responded well and were backed up by excellent fielding on a gloomy final day.
Left-arm spinner Prabath Jayasuriya continued to impress in his third test match, finishing with a five-wicket haul, and eight wickets for the game, to be named player of the series.
He was backed by off-spinner Ramesh Mendis, who took four wickets in the second innings.
Resuming play at 89-1, Pakistan lost opening batter Imam-ul-Haq in the third over of the morning but a 79-run stand between captain Babar Azam and Mohammad Rizwan gave hope of a draw that would secure a 1-0 series victory.
However, a moment of indiscretion saw Rizwan leaving a straight ball from Jayasuriya and he was bowled for 37. A collapse from the visitors' middle order soon followed as they went from 176-2 to 188-5 by lunch.
Babar was Sri Lanka's biggest challenge, and Pakistan's only remaining hope, but he was dismissed leg before wicket by a straight ball from Jayasuriya for 81.
The last five Pakistani wickets fell for 56 runs.
Dhananjaya de Silva was leading Sri Lanka in the absence of skipper Dimuth Karunaratne, who was out with back spasms. De Silva scored a century in Sri Lanka's second innings and was named Man of the Match.
The series is being played against the backdrop of Sri Lanka's worst economic crisis since independence. There is a severe shortage of fuel, medicine and cooking gas and economic experts have warned of a pending food crisis.