In between the showers at Hagley Oval in Christchurch, Williamson was in classic form, batting for nine hours 33 minutes for his 238 and leading New Zealand to an imposing 659 for six declared to lead Pakistan by 362.
At stumps, the tourists were already in trouble at one down for eight, with Kyle Jamieson adding to his five-wicket haul in the first innings by removing Shan Masood for a duck.
Should New Zealand win the Test it will confirm their ranking as the number one side in the world for the first time — to go with Williamson’s promotion as the number one batsman — and keep alive their chance of making the World Test Championship final.
It was a relentless performance from Williamson who became only the second New Zealander after Brendon McCullum to score four double centuries.
He should have been out for 177 on the first ball after the first of two rain stoppages, but as has happened several times in the Test the chance was put down — this time by Azhar Ali, who earlier in the day had dropped Henry Nicholls short of his century.
Williamson and Nicholls had rebuilt the innings after New Zealand were reduced to 71 for three on Monday’s second day.
By the time Nicholls was dismissed early in the afternoon session for 157, the pair had put on 369, the third-best all-time partnership for New Zealand and a record for the fourth wicket.
The day resumed with New Zealand 286 for three, 11 runs in arrears and with conditions favourable for the bowlers who had cloud cover and a ball only five overs old.
But for every plan Pakistan set to dismiss Williamson, he had an answer — with a range of strokes from silky touches to powerful drives.
Along the way he followed Ross Taylor and Stephen Fleming to become only the third New Zealander to pass 7,000 runs.
The end came for Williamson three overs before tea when he skied a short ball from Faheem Ashraf and was caught in the deep by Masood.
In four innings from three Tests in the past month Williamson has scored 251, 129, 21 and 238.
Nicholls, dropped on 92 and 133, was hampered by a calf strain which left him hobbling between the wickets.
But he was still able to attack, with boundaries producing 48 of his 68 runs on day three, before he top-edged a short ball from Mohammad Abbas and was caught at deep fine leg.
Daryl Mitchell clobbered 102 off 112 balls with Williamson delaying the declaration until the all-rounder posted his maiden century.