Sri Lanka spinner Rangana Herath took his tally to 14 wickets in the match as Mahela Jayawardene's 17-year Test career ended with a series victory over Pakistan.

Herath, who plundered nine wickets in the first innings, claimed five for 57 as the Sri Lankans rolled Pakistan over for just 165 before lunch on Monday to secure a 105-run victory and hand Jayawardene the perfect swansong.

The batsman, whose final Test innings had ended on 54, was carried around the field in Colombo by his team-mates in front of Sri Lanka president Mahinda Rajapaksa after the conclusion of a 2-0 series win.

Speaking at the post-match presentation, 37-year-old Jayawardene, who will continue to play one-day international cricket until after next year's World Cup, said: "I don't know what to say, but I promise I won't cry.

"I love you all. Thank you so much for the support all these years. I still have a little bit left and I promise I'll give it my all for the World Cup.

"Thanks also to my team-mates. It's been great to play for Sri Lanka for so many years. I have always worn this cap with pride and passion."

Pakistan resumed their second innings on the final day at 127 for seven chasing an improbable 271 for victory and with number 11 Junaid Khan unable to bat because of injury.

In the event, even the threat of a rain delay could not hold up Sri Lanka, who took 40 minutes to get the ball rolling when Sarfraz Ahmed was caught sweeping Chanaka Welegedara to deep square leg to end his 29-run partnership with Wahab Riaz.

Wahab was the last man to go as Herath extended his match haul to a remarkable 14 for 184.