Rangana Herath grabbed 6-48 as Sri Lanka beat Pakistan by seven wickets on a dramatic last day of the first Test.
Pakistan first innings 451
Sri Lanka first innings 533-9d
Pakistan second innings 180
Sri Lanka second innings
U Tharanga b Junaid 12
M Jayawardene b Junaid 26
K Sangakkara c Manzoor b Talha 21
A Mathews not out 25
D Vithanage not out 11
Extras (lb 3, w 1) 4
Total (3 wickets; 16.2 overs; 87 mins) 99
Fall of wickets: 1-28, 2-59, 3-73
The left-arm spinner turned the game on its head when Pakistan, which trailed by 82 after the first innings, was bowled out for 180. Sri Lanka then needed 99 runs in a minimum 21 overs with dark clouds hovering over the Galle International Stadium.
Captain Angelo Mathews (25 not out) showed urgency by hitting two sixes and two fours as Sri Lanka reached 99-3 in 16.2 overs - just in time before the rain arrived.
Mahela Jayawardene, who will quit after the second Test, set the tempo with a quick 26 before Mathews took charge under bad light.
It was Pakistan's fourth loss in a Test match after scoring more than 450 runs in the first innings. The visitors will look to spoil Jayawardene's farewell test in his hometown Colombo when the second Test begins on Thursday.
Kumar Sangakkara's 10th double century (221) helped Sri Lanka respond solidly by declaring at 533-9 after Younis Khan hit a brilliant 177 in Pakistan's first innings total of 451.
But Pakistan's batsmen paid a heavy price of protecting their wickets instead of scoring runs after resuming the day at 4-1 as Herath got rid of the top order before mopping up the tail just after tea.
Wicketkeeper-batsman Sarfraz Ahmed top scored with an unbeaten 52 before he ran out of partners.