Younis Khan scored an epic unbeaten 171 to guide Pakistan to their highest successful run chase and a seven-wicket victory over Sri Lanka in the third Test in Pallekele on Tuesday.
It enabled the tourists clinch the three-match series by a 2-1 margin.
Pakistan chased down the daunting 377-run target in the second session of the final day when skipper Misbah-ul Haq (59 not out) blasted Jehan Mubarak for a six to seal their first Test series win in Sri Lanka since 2006.
Shan Masood (125) was the only Pakistani batsman to fall on Tuesday, having added a remarkable 242 runs with Younis to turn the match on its head after Sri Lanka had seized control.
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.
Younis continued to play with his characteristic fluency, however, and was unbeaten after registering his 11th 150-plus score in Test cricket, the most by any batsman from his country.
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, was named man-of-the-series.
Image: Younis Khan
Photograph: ICC on Twitter