Christchurch - It was the dream script for Brendon McCullum's farewell - a captain's rescue innings in which he bludgeoned records and ensured New Zealand would be a force in the second Test against Australia on Saturday.
At stumps, Australia were 57/1 after McCullum's blistering 145 set New Zealand up for a first innings 370 at Christchurch's Hagley Oval.
David Warner was gone for 12 with Joe Burns not out 27 and Usman Khawaja on 18.
It was McCullum's day as he smashed a world record 54-ball century and raised the record for the most Test sixes to 106 in a typically brutal onslaught.
His 145 took 79 deliveries and was supported by Corey Anderson (72 off 66) while BJ Watling added 58.
The day started in Australia's favour when they won the toss, and had New Zealand reeling at 32-3 after 20 overs on another green wicket.
That was when McCullum stepped out and once he had passed through the Australian guard of honour, and the standing ovation from the crowd had died down, he unleashed his battery of cultured and unorthodox strokes.
He reached his century in 54 balls, two better than the previous world record shared by the West Indies' Viv Richards and Pakistan's Misbah-ul-Haq.
The first of his six sixes saw him set a new world record for total Test sixes, overtaking Australian Adam Gilchrist, who hit 100.
McCullum's innings in his 101st and final Test underlined his fondness for Hagley Oval, a purpose-built arena after Lancaster Park was destroyed in a devastating 2011 Christchurch earthquake that claimed 185 lives.
In his only other Test on the ground, McCullum smacked 195 off 134 balls.
Martin Guptill tried to knock the Australian bowlers off their line at the start of the innings but was gone for 18.
Kane Williamson attempted to outlast the Australians with seven off 69 as did Tom Latham with four from 40.
But when Anderson joined McCullum at 74-4, it brought two king hitters together in a 179-run stand off 110 deliveries.
Josh Hazlewood, who took an impressive four wickets when New Zealand crumpled on a green wicket in the first Test, took the brunt of the punishment.
Hazlewood had impressive figures of 10-5-11-1 at lunch but his next eight overs cost 87.
Mitchell Marsh also suffered when McCullum took 21 off his first over.
Marsh did pull off a spectacular catch early in McCullum's innings but the batsman was called back when replays showed the James Pattinson delivery was a no ball.
McCullum added 106 before Pattinson eventually claimed the wicket when Nathan Lyon lunged forward at long leg to take the catch.
Anderson clubbed eight fours and four sixes before he was caught at cover by Adam Voges to give Lyon the first of his three wickets.
Watling, batting at a run-a-ball pace, brought up his 11th half century off Jackson Bird with a streaky edge that shot past the keeper for four.
In his following over, Bird removed Watling to end the innings.
Australia, who need to win the Test to claim the number one world ranking, made only one change with Pattinson replacing the injured Peter Siddle.
New Zealand made two changes with Matt Henry in for the injured Doug Bracewell while Neil Wagner was called up as fourth seamer to replace spinner Mark Craig.