After setting Pakistan 418 runs to win in the first match of a two-Test series, Sri Lanka dismissed the home side for 216 runs from 79.2 overs 40 minutes after lunch.
Left-arm spinner Rangana Herath, playing in his sixth Test, returned career best figures of four for 64 to finish with match figures of seven for 132.
Pakistan lost their last three wickets after lunch for 46 runs after resuming on 170 for seven. Shoaib Malik was the top scorer with 59 from 177 balls.
The victory was Sri Lanka's sixth in nine Tests in Pakistan and their seventh overall.
Pakistan resumed on 114 for four with the difficult task of having to play out 83 overs to save the game.
Herath triggered a batting collapse with two wickets in two balls after the overnight pair of Yousuf Youhana (44) and Malik had added 40 runs to the total in 17 overs and 75 minutes.
They put on 63 runs for the fifth wicket from 205 balls before Herath trapped Youhana in front with a fine arm ball.
Malik negotiated the next over from Chaminda Vaas safely but with the first ball of his next over Herath trapped Abdul Razzaq leg before for a first ball duck.
New man Moin Khan, whose place in the team has been under threat due to his poor batting form, averted the hat-trick but in the next over he edged Vaas to keeper Kaluwitharana to fall for one run having faced just four balls.
In the fourth over after lunch Mohammad Sami was run out by a direct throw from Marvan Atapattu for six trying to steal a single in the covers. Malik struck a few lusty blows, including three fours off Dilhara Fernando in one over to reach his maiden half-century, before he was also dismissed.
Scorecard:
Sri Lanka first innings 243 (T.Samaraweera 100; S.Akhtar 5-60, M.Sami 4-71)
Pakistan first innings 264 (Y.Hameed 58; R.Herath 3-68)
Sri Lanka second innings 438 (S.Jayasuriya 253, K.Sangakkara 59, M.Jayawardene 57; D.Kaneria 4-117)
Pakistan second innings
Yasir Hameed lbw Fernando 17
Imran Farhat lbw Fernando 53
Asim Kamal b Fernando 1
Inzamam-ul-Haq b Fernando 3
Yousuf Youhana lbw Herath
44 Shoaib Malik c and b Herath 59
Abdul Razzaq lbw Herath 0
Moin Khan c Kaluwitharana b Vaas 1
Mohammad Sami run out 6
Shoaib Akhtar st Kaluwitharana b Herath 12
Danish Kaneria not out 0
Extras (b-4, lb-1, w-6, nb-9) 20
Total (all out in 79.2 overs) 216
Fall of wickets: 1-59, 2-65, 3-86, 4-91, 5-154, 6-158, 7-159, 8-187, 9-215
Bowling: Chaminda Vaas 16-4-54-1 (1-nb, 5-w), Lasith Malinga 6-2-13-0 (2-nb), Rangana Herath 32.2-10-64-4, Dilhara Fernando 20-3-77-4 (1-w, 6-nb), Sanath Jayasuriya 4-2-2-0, Jehan Mubarak 1-0-1-0.
Result: Sri Lanka won by 201 runs
Second Test at Karachi from Oct 28.
More from rediff