Younis Khan posted an unbeaten 306 to steer Pakistan to 574 for five in reply to Sri Lanka's 644-7 declared as the first cricket Test meandered to a draw with only a day remaining.
Skipper Khan, only the 20th batsman and third Pakistani to surpass 300 runs in a test innings, guided the hosts past the follow-on target and within 70 runs of Sri Lanka's first innings total by stumps on Tuesday on a lifeless wicket at National Stadium. His patient innings over 12 hours and 11 minutes featured 27 fours and four sixes from 545 balls and a superb range of strokes on both sides of the wicket.
"I dedicate this innings to my family, my friends and my teammates who have always supported me," Khan told reporters. "The team needed innings like that from someone and I was lucky I did it for my team."
It was the first time in test cricket's 132-year history that both captains have scored more than 200 in the same test match. Mahela Jayawardene, who will step down from the Sri Lanka captaincy after the second test at Lahore next month, made 240 and shared in a world record fourth-wicket stand in the first innings. Khan raised his triple century in the last session Tuesday when he played a reverse sweep off star spinner Muttiah Muralitharan and ran for three runs.
Khan is now aiming for Pakistan's test-best of 337 made by Hanif Mohammad against the West Indies at Barbados in 1958. Inzamam-ul-Haq is the only other Pakistani triple century-maker. He scored 329 against New Zealand at Lahore in 2002.
Khan featured in two century stands after Pakistan resumed its first innings at the overnight total of 296-3 and still needed 149 runs to avoid the follow on.
He put on 174 runs with Faisal Iqbal (57), nephew of former captain Javed Miandad, after adding 130 for the fourth wicket with Misbah-ul-Haq (42).
Khan, who came out to bat late on the second day in his 59th test, frustrated the Sri Lanka bowlers on a flat wicket which has come under severe criticism with bowlers struggling to get any assistance.
Muralitharan (1-165), test cricket's most prolific wicket-taker, and Ajantha Mendis (1-135) have succeeded in getting just one wicket each as only 12 wickets have fallen in the game with just one day remaining.
Khan, 149 overnight, raised his double century in the afternoon session when he drove a delivery from fast bowler Dilhara Fernando through the covers for three runs.
He also became the sixth Pakistani batsmen to complete 5,000 test runs, joining Miandad, Inzamam, Khalid Ibadulla, Mohammad Yousuf, Salim Malik and Zaheer Abbas.
Sri Lanka managed only two wickets on Tuesday. Fast bowler Fernando (1-107) trapped Misbah-ul-Haq (42) lbw shortly before lunch. Misbah hit three fours and a six in his 153-ball knock.
As the wickets dried up for Sri Lanka's strike bowlers, Jaywardene bowled his gentle medium pace in the last session and got the only other breakthrough when he trapped Iqbal lbw. Iqbal hit six fours.