Sri Lanka claimed the extra half-hour at the end of the fourth day to complete a 209-run rout of Pakistan in the first Test on Monday.
The visitors, chasing an unlikely victory target of 510, were bowled out for 300.
The game looked like dragging on to the fifth day when fifth-wicket pair Younus Khan (87) and Asad Shafiq (80) put up stubborn resistance with a stand of 151.
After the pair were removed, Mohammad Ayub (22) and Adnan Akmal (40 not out) continued to frustrate the Sri Lankan bowlers.
When the extra half-hour started Pakistan were 279 for eight but Suraj Randiv snapped up the last two wickets to finish with figures of three for 86 in the second innings and seven for 99 in the match.
Shafiq hit 13 fours in an attractive innings before edging a catch to Mahela Jayawardene at slip off Rangana Herath.
Former captain Younus struck seven fours to thwart the home attack until he was finally undone by the second new ball after tea, caught behind by Prasanna Jayawardene off Nuwan Kulasekara.
Debutant Ayub then presented Nuwan Pradeep with his first Test wicket when he was trapped lbw.
Earlier, Sri Lanka broke through in the second over of the day when nightwatchman Saeed Ajmal (12), sent back by Younus after he charged down the wicket, failed to beat Randiv's direct hit from extra cover.
Kumar Sangakkara then dropped Shafiq off Randiv at short mid-wicket when he was on 33.
Younus also survived an anxious moment when Tillakaratne Dilshan dived forward at mid-off to take a 'catch' but the batsman was adjudged not out by the third umpire.
Paceman Kulasekera ended with figures of three for 48 while spinner Herath picked up two for 91.
Sangakkara was named man of the match for his 199 not out in the first innings.
The second Test in the three-match series is in Colombo starting on Saturday.
Pakistan face tough task to save first Test
Sangakkara misses milestone but Pakistan toil
Mendis included in SL squad for first Test against Pak
Pak names separate Test, ODI, T20 squads for Lanka tour
Fifth ODI: Mathews stays cool to steer Sri Lanka home