Williamson was on 190 with Watling (118) in an unbroken 286-run partnership as the hosts rattled up a lead of 310 runs.

The highest successful fourth innings run chase at the Basin Reserve was the 277 for three by Pakistan in 2003, though New Zealand captain Brendon McCullum would be aware the pitch was still good for batting and Kumar Sangakkara was in fine form after his first innings of 203.

Sri Lanka must win the game to level the two-match series after losing the first test in Christchurch by eight wickets.

Williamson and Watling had been thrust together after lunch on Monday at 159 for five, with New Zealand holding a 24-run lead and in danger of losing the game inside three days.

But the pair battened down the hatches and played conservatively, ticking off each run and each session as they took the hosts to 253 for five at the close on Monday.

They then patiently collected singles and rotated the strike in the first session, taking them to lunch on 325 for five, with Williamson having brought up his ninth test century with a quick single off Dhammika Prasad and went to lunch on 121 not out.

Watling had resumed after lunch on 76 and slowly edged towards his century, which he achieved with a short single into the offside.

Williamson, who was dropped on 29, 60 and 104, scored 192 against Pakistan last year, his highest test score to date.

Latest News from Sports News Desk