South Africa 38 for 1 (Amla 23*, Boult 1-6) and 308 lead New Zealand 341 (Williamson 130, Raval 52, Watling 50, Maharaj 5- 94) by five runs
Scorecard and ball-by-ball details
For a third day in a row it was difficult to split the two teams, but the final session in Dunedin provided one of the more action-packed periods of the Test - for a variety of reasons. A limping Ross Taylor helped New Zealand extend a narrow lead; Neil Wagner clubbed boundaries; Stephen Cook fell for a duck when he appeared not to hit the ball; and a fire alarm stopped play, leading to the ground being evacuated.
Midway through the seventh over of South Africa's second innings the alarm in the main stand at University Oval sounded. Play halted, teams and officials strode into the middle of the pitch, the fire crews arrived and supporters were asked to leave. A few minutes later the all-clear was given, but fading light meant New Zealand could not bowl their quicks.
Dean Elgar and Hashim Amla negotiated the spinners, pushing South Africa back into the lead until bad light finally ended play with 10 overs remaining.
The upshot was that the match remained evenly poised, although an iffy forecast for Sunday did not bode well for either to force a result unless New Zealand make swift inroads on the fourth morning. There has been some compelling cricket, but overall the match has progressed at a lethargic pace so far.
New Zealand's promising position was engineered by Kane Williamson's 16th Test century, a wonderful display of batsmanship, and a gritty fifty from BJ Watling. Their approach was cautious until Wagner started swinging, but it was understandable given Taylor's calf injury which basically left them without a key batsman. At 277 for 5, when Williamson and Watling had taken their stand to 84, a bigger lead was possible but Keshav Maharaj collected his maiden five-wicket haul in Test cricket.
The 33-run advantage looked a little more significant when Trent Boult struck in his first over, Cook seemingly edging behind when a delivery slanted across him. Cook was content to walk off, but replays suggested he had clipped his pad rather than nick the ball. There were not too many alarms in the gloom for Elgar and Amla, with Jeetan Patel bowling a touch too full, and the fourth day will be the litmus test of New Zealand's twin spin attack.
New Zealand resumed on 177 for 3 and barring a couple of early drives from nightwatchman Patel - who was brilliantly held at slip by Faf du Plessis - scoring was hard work. Williamson did not add to his overnight 78 for the first 50 minutes of play in the face of demanding pace bowling and Jimmy Neesham edged Morne Morkel behind in somewhat controversial circumstances.
Morkel found the outside edge but it was mighty close to a no-ball. Rod Tucker, the third umpire, took nearly three minutes to decide it was a legal delivery, ruling that when Morkel's toe became grounded a fraction of his heel was behind the popping crease even though raised.
Williamson made better progress in the second hour, reaching his hundred from 195 balls when he lapped a full toss from JP Duminy. It was his third century as captain, but on a different level to the previous ones against Zimbabwe and Bangladesh, and took him to within one of Martin Crowe's record of 17 hundreds. He continued to purr along early in the afternoon, alongside the gritty Watling, before Rabada found his outside edge with one that nibbled with the new ball.
It ended a stand of 84 alongside Watling and almost brought the innings to a halt. Mitchell Santner survived an early DRS call for caught behind and played one scoring shot off 41 deliveries - that came off his fourth delivery - before driving a full, wide delivery from Morkel low to cover.
Watling, who had been troubled by a knee injury ahead of this series, was rarely fluent but showed his trademark determination to eke his way to a 127-ball fifty, his first in 14 Test innings, which kept the match on even terms. He became Maharaj's third wicket when a delivery cannoned off his pads into the stumps with New Zealand not quite in the lead.
Maharaj's performance was reward for another important role as part of South Africa's four-man attack which helped share the bowling workload. He completed his five-wicket haul by beating Boult's charge down the pitch and having Wagner taken at point. Wagner had struck the ball sweetly, taking 14 off three consecutive deliveries from Philander including a pull for six, to take New Zealand into the lead.
Taylor, having been diagnosed with a low grade calf strain, returned at the fall of the ninth wicket and though he could barely walk managed to swat Morkel for a six onto the grass banks. His prognosis for the rest of the series remained unclear. As did the outcome of this match.