New Zealand had been left a nominal target of 389 with a minimum 81 overs available.
It was a gripping day as the batsmen strove to survive over by over; with every wicket, South African hopes grew.
It was Williamson's second test hundred, after his century on debut in India two years ago. His stature grew as the day wore on. In tandem with Bracewell's grit, they forced the door shut on South Africa's ambitions.
To South Africa went the tour spoils, the 1-0 series win going with earlier T20 and ODI series victories.
New Zealand's cricket in the first hour was poor. They were lackadaisical in the field, the body language was distinctly ordinary, as they sat back waiting for the declaration.
So South Africa filled their boots, belting 114 in 14.4 overs.
The timing of Graeme Smith's declaration, about 30 runs later than most had anticipated, had the effect of telling New Zealand they had no chance of pulling off an always unlikely run chase. They had to bat hard and well with no chance of victory.
The crunch moment of the day came before lunch, after Morkel had quickly whistled out Daniel Flynn and Brendon McCullum.
Williamson, on seven, pushed a ball to point where Alviro Petersen appeared to take a low catch. Williamson stood his ground, and third umpire Billy Doctrove, after endless replays, gave him a reprieve.
Poor camera work helped Williamson. Was the catch fair? Probably. Was Williamson within his rights to hang about? Yes, if he was unsure. Were the South Africans livid? With bells on.
And that set the tone for the rest of the day as Morkel and luckless Dale Steyn, in particular, put New Zealand through hoops.
It was a furious, unrelenting attack, a case of duck, bob and weave much of the time, and wearing the verbal sprays too.
For a long period few balls landed in the bowler's half of the pitch. The batsmen must have felt they were on the end of a coconut shy.
Through it all little Williamson stood tall. He had two lives, at 10 and 22 - two of four catches dropped in the innings - but his commitment to the job, and ability to keep his ears closed, was immense.
Martin Guptill, Dean Brownlie and Kruger van Wyk all did their part - precious time mattered far more than runs - with Brownlie probably wondering what he'd done to deserve his severe treatment, as Steyn went around the wicket and hurled down a stream of short-pitched fliers.
He was struck on the right shoulder; Williamson had his protective box split by Steyn - van Wyk took a blow in the most personal place too - but New Zealand batting hearts were staunch when it was most needed. And by the end, the crowd had that rarest of things in this series, a New Zealand batting hero to cheer.