Younis Khan remained unbeaten after a brilliant 171 as Pakistan beat Sri Lanka by seven wickets in the final Test to win the three-match series 2-1 at Pallekele.
Chasing a daunting 377-run victory target, skipper Misbah-ul-Haq (57) hit Jehan Mubarak for a six to seal Pakistan's first Test series win in Sri Lanka since 2006.
The 377 was also Pakistan's highest successful run-chase and the second overall in Asia.
Shan Masood (125) was the only wicket to fall on the final day of the pulsating Test, and the Pakistan opener was out after adding 242 runs with Younis that turned the match on its head.
1 South Africa
4 New Zealand
7 Sri Lanka
8 West Indies
Younis faced 271 balls in his marathon unbeaten knock, hitting 18 boundaries in his 11th 150-plus score, which is highest by any Pakistani batsman.
Shot out for 215 in the first innings and reeling at 13-2 in the second, Pakistan's stunning victory also saw them jump three places up to third in the Test rankings.
Pakistan began the final day needing 147 for a memorable win and off-spinner Tharindu Kaushal drew Masood out of his crease with flight and turn to have him stumped.
The opener had earlier survived a strong caught-behind appeal when he was on 120 with bowler Angelo Mathews and wicketkeeper Dinesh Chandimal convinced he had edged it.
Umpire Ian Gould, however, deemed otherwise and Sri Lanka moved on having exhausted both of their review opportunities.
The 37-year-old batted for more than seven hours in a man-of-the-match display, also becoming the first batsman to score five fourth innings centuries in Test cricket.
Pakistani leg-spinner Yasir Shah, who claimed 24 wickets in three matches, won the man-of-the-series award.
"It is such a big victory," said Misbah.
"After the Younis-Masood partnership, it was easy for us. The youngsters are doing well for the team. When seamers did not get wickets in the first innings, Yasir bowled tight lines and showed his variations.
"Then Imran came in on the fourth day and too five wickets."
Sri Lanka 278 all out and 313 all out (Mathews 122, Imran 5-58)
Pakistan 215 all out and 382-3 (Younis 171*, Lakmal 1-48)
Source: Al Jazeera and agencies