Brendon McCullum blasted the fastest Test century to rescue New Zealand before Australia were reduced to 57 for one by the close of day one of the second test on Saturday.
The New Zealand captain scored a brilliant 145, with his first 100 runs coming from 54 balls, as the hosts were dismissed for 370 after tea at Hagley Oval in Christchurch.
Trent Boult then had the dangerous David Warner caught at second slip by Martin Guptill for 12, before Joe Burns (27) and Usman Khawaja (18) saw the Australians through to the close.
New Zealand had no right to be in the position they were at stumps after being sent in to bat by Steve Smith on a green wicket and reduced to 32 for three inside 20 overs.
“After losing the toss anything could have happened,” said McCullum.
“The wicket had plenty in it all day and we decided the best form of defence was for us to try to attack.
“It’s not always going to come off but today we got a bit of luck along the way and as we sit here at the end of day one we’re firmly in the test match.”
McCullum, playing his 101st and final Test with his team trailing 1-0 in the two-match series, led the counter-attack that began before lunch and reached its bludgeoning best in the afternoon session.
The height of the onslaught came after McCullum was caught in the gully by an acrobatic Mitchell Marsh when on 39, only to be recalled as television replays showed fast bowler James Pattinson had over-stepped.
Already bristling with aggression, the second life flicked a switch for McCullum and he went into all-out attack mode, reaching his century 24 balls later with his 16th boundary.
He needed two fewer balls than the 56 that West Indies’ Viv Richards required for his century against England in Antigua in 1986 and Pakistan’s Misbah-ul-Haq took against Australia in Abu Dhabi in 2014.
McCullum also hit four sixes in his first 100 runs, his first before lunch securing outright ownership of the record for career sixes in test cricket. He had started the day tied with Australia’s Adam Gilchrist on 100.
He was eventually dismissed when Nathan Lyon took a good catch in the deep to end a 179-run partnership with Anderson, who reached his fourth test half-century from 39 balls and was dismissed for 72 shortly before tea.
Lyon grabbed two wickets after tea, with wicketkeeper BJ Watling the last man out for 58.
“Credit to Baz in the way he played,” Lyon said.
“He rode his luck. I thought as a bowling unit we toiled quite hard and as a fielding unit we took a lot of good catches.
“It’s a big positive to bowl them out on day one.”