Sri Lanka successfully completed a final-session run-chase to take their first Test with Pakistan in Galle.
After bowling their visitors out for 180 just after tea on the last day - Rangana Herath leading the way with six for 48 - the home side quickly rattled up the 99 runs they needed to record a seven-wicket win.
They still had a minimum of 4.4 overs remaining when the winning run was hit, showing how easily they got to the mark.
Captain Angelo Mathews was unbeaten on 25 at the end, with Mahela Jayawardene (26) and Kumar Sangakkara (21) having also chipped in.
Their run-chase came about after Pakistan - four for one at the start of the day - slumped to 180 all out.
Sarfraz Ahmed made 52 of them, making Sri Lanka's job a little bit harder than it might have been, but - Azhar Ali apart - he had no support.
With Khurram Manzoor having perished on Saturday, Pakistan needed a solid start but nightwatchman Saeed Ajmal was unable to provide it, giving an outside edge behind off Dhammika Prasad.
Ahmed Shehzad was the next to go for 16, lbw to Dilruwan Perera, with Younis Khan then getting cleaned up by Herath.
Azhar Ali was the fifth man to go, edging Herath behind and there was no let-up as Misbah-ul-Haq was pinned lbw on the back foot to Perera.
Asad Shafiq also went leg-before, in his case on the front foot to Herath, before Abdur Rehman and Mohammad Talha both nicked behind for one and four respectively.
And then, when Junaid Khan was trapped by Herath, the game was up, leaving Sri Lanka with the chance to steal a march in the two-Test series.
Junaid got rid of Upal Tharanga and Jayawardene but it was not enough to cause a panic, especially with his eight overs going for 55 runs.