Kumar Sangakkara changed the complexion of the second Test against New Zealand with an outstanding double century as the visitors finished day two with a 113-run lead.
Sangakkara made 203 in Sri Lanka's 356 and held together four important partnerships that rescued his side from a precarious 78 for five at the start of play at Basin Reserve in Wellington on Sunday.
The 37-year-old's 11th Test double century moved him to within one of the record held by Australia's Don Bradman since 1948.
The visitors, who need to win to level the two-match series, were dismissed with about an hour's play remaining to give Sri Lanka a 135-run lead after New Zealand were bowled out for 221 on the first day.
The hosts finished the day on 22 without loss, with Tom Latham on nine and Hamish Rutherford 12 not out.
Sangakkara, who became the fastest cricketer to score 12,000 Test runs on Saturday, dominated the day's play and was at his imperious best, stroking the ball to all parts of the sun-drenched Basin Reserve.
Sri Lanka had been in danger of conceding a first innings deficit when Sangakkara and Dinesh Chandimal strode to the wicket on Sunday and while they initially suffered some nervous moments, they flourished throughout the morning session.
They eventually put together a 130-run partnership that took the visitors within sight of New Zealand's total before Chandimal was dismissed for 67.
Sangakkara brought up his century with a punch through the covers for three runs off Mark Craig, and then began to up his scoring rate as he combined in three partnerships worth 148 runs with his bowlers, of which he scored 110 runs.
He got his double century with a cover drive off Jimmy Neesham for his 18th boundary before he was spectacularly caught one handed by a diving Trent Boult at point five balls later.