(CNN) -- Sri Lanka produced a stunning 50-run win inside four days over Pakistan in the first Test at Galle to go 1-0 up in their three-match series.
Sri Lanka celebrate an unlikely first Test victory after Pakistan collapse to 117 all out in Galle.
Pakistan had started the fourth day needing only 97 to reach their target of 168 with eight wickets in hand, but were undone by superb spells from left-arm paceman Thilan Thushara and left-arm spinner Rangana Herath.
The pair produced an astonishing turnaround with two wickets apiece in quick succession which left Pakistan -- 71 for two overnight -- reeling at 80 for six within the first seven overs of the day.
Misbah-ul-Haq was then run out before Ajantha Mendis claimed another victim.
Herath added two more scalps to his tally to finish with figures of four for 15 from 11.3 overs as Pakistan were bowled out for 117 just before the lunch interval.
Thushara had begun proceedings with an impeccable first over, before Herath claimed two Pakistan wickets in the first over from the other end.
Mohammad Yousuf, who scored 112 earlier in the match to hand the tourists a 50-run first-innings lead, was dismissed from Herath's first ball, trapped in front while playing down the wrong line.
Yousuf departed without further addition to his overnight 12 and Pakistan slipped further into the mire when the other overnight batsman Salman Butt succumbed three deliveries later.
Butt, who had batted flawlessly for his 28, produced an ill-timed and badly-executed slog sweep which went straight to Tharanga Paranavitana at deep square leg.
Thushara then got into the act, removing Shoaib Malik for a duck. The left-armer caught the edge of Malik's bat with the first delivery of his second over, but the ball dropped just short of first slip.
But Thushara's pace and angle of attack soon induced another edge which wicketkeeper Tillakaratne Dilshan gloved neatly.
Kamran Akmal's innings came to an end when he was rapped on the back leg in front of the stumps by a Thushara delivery.
Pakistan's faint hopes rested on Misbah, but Pakistan's vice-captain was soon back in the pavilion, brilliantly run out by Dilshan.
Mendis then snared Gul before Herath mopped up the tail as the home side scored a memorable victory.
The second Test begins in Colombo on Saturday.