Herath took 5-57 in the second innings to propel Sri Lanka to a 105-run victory on the final morning of the second Test after Pakistan were dismissed for 165 chasing 271 at the Sinhalese Sports Club.

He finished with a career-best 14-184 for the match, surpassing his previous mark of 12-157 against Bangladesh last year, and increased his series tally to 23 wickets after a match-winning performance in the first Test at Galle.

He was named both player of the match and the series.

"We knew they were going to come hard at us. They play our spinners very well as well. So it's just that we won those difficult situations, and I thought those little phases we had to fight really hard, we fought really hard," Sri Lanka captain Angelo Mathews said.

"I am pretty pleased the way the whole team turning up wanting to win every day. Starting from the second Test against South Africa up to now it has been brilliant."

Sri Lanka lost the home Test series against South Africa last month.

Pakistan captain Misbah-ul-Haq said Herath was the difference between two teams and said there was no shame in losing to a better team.

"It's (losing) a part of the game, but you haven't lost to a low-ranked as they are the fine side and recently won a series against England, so they have been playing well. Losing to them isn't really what you call a humiliation as they played better cricket than us," said Misbah.

"You only learn from your defeats and it's not like we played bad cricket. We did play good cricket, but they were little bit better than us. When you lose 2-0 or 1-0 it's not different, but you never get disappointed, rather try to improve with every game you play and move on."

Jayawardene ended his 149-match, 17-year Test career with 11,814 runs at an average of nearly 50. His contribution in his last match was 58 runs, including a half-century in the second innings and three catches at his customary slips position. The 54 he scored in his last innings was his 50th half-century. He also posted 34 Test centuries in a long and distinguished span at the elite level.

After Kaushal Silva caught Wahab Riaz for the last wicket, Jayawardene was carried off the Sinhalese Sports Ground on the shoulders of his teammates.

President Mahinda Rajapaksa, who was a guest, handed Jayawardene a souvenir to mark the occasion.