New Zealand claimed the Rugby Championship title after winning a breathless encounter 38-27 against South Africa in Johannesburg.

The lead changed hands several times in the all-action clash but New Zealand's black tide swept to victory as they outscored South Africa by five tries to four and finished off their unbeaten run with a flourish to claim the silverware.

South Africa fly-half Morne Steyn opened the scoring from the penalty tee to give the Springboks an early lead but that was quickly cancelled out by Ben Smith's try at the other end, after he cut inside before crossing the whitewash to silence the Ellis Park crowd.

Aaron Cruden converted but Bryan Habana soon had the home crowd back on their feet when the wing showed great awareness to claim Duane Vermeulen's cut-out pass and cross for a try before he added his second two minutes later when he raced onto the end of his own chipped kick.

Fly-half Steyn converted the first score but Habana's dream start was brought to an abrupt halt as he pulled up with what looked to be a hamstring injury and left the field midway through the first half.

New Zealand hit back with a forwards' try for Liam Messam who had hold of the ball as the All Blacks' pack drove over the line with Cruden converting to take the visitors back to within one point.

The game settled down after the frenetic start but New Zealand finished the first half the strongest as they again surged towards the Springboks, with Messam claiming his second try of the match in the final play after the hooter as South Africa were left to rue the decision to run the ball out of their defence.

Cruden added the extras as the All Blacks took a 21-15 lead into the break.

South Africa edged ahead at the start of the second half through wing Willie Le Roux's converted try and the game then really opened up, with both sides desperate to run the ball at every opportunity.

Le Roux almost scored again but for some last-ditch defending before New Zealand centre Ma'a Nonu was denied the try which would have wrapped up the Championship for the All Blacks.

Substitute Beauden Barrett did, however, fire a penalty, but Jean de Villiers put the Springboks back ahead after he barged over the line to claim the bonus-point try and give his side hope of victory.

However, Barrett crushed those dreams moments later when he crossed for New Zealand's fourth try of the game, giving them the point they needed to take the title out of South Africa's reach with 20 minutes still remaining.

Number eight Kieran Read was then unstoppable down the left wing as he powered over the line for another converted score as New Zealand stamped their authority all over the game and ensured victory to go along with the title.