Defending champions New Zealand produced a clinical display to hold off a spirited South Africa in their World Cup Pool B opener in Yokohama.
The Springboks started brightly and took the lead with a Handre Pollard penalty before the All Blacks hit back.
Richie Mo'unga drew New Zealand level and two quick tries by George Bridge and Scott Barrett put them in front.
Pieter-Steph du Toit's try and a Pollard drop-goal made it tense before Mo'unga and Beauden Barrett penalties.
The result means New Zealand extend their winning run to 15 games in the competition, last losing to France in the 2007 quarter-finals.
South Africa play Namibia next on Saturday, 28 September (10:45 BST), while the All Blacks face Canada on 2 October (11:15).
All Blacks show their class
Both countries are expected to make the latter stages of this tournament and they both impressed in a thoroughly entertaining Test match.
For the first 20 minutes, South Africa held a slender lead as they looked to impose themselves on the All Blacks with plenty of front-foot ball.
The influential scrum-half Faf de Klerk was pulling the strings as the Springboks won 20 rucks in the first 15 minutes.
But when Pollard's second penalty came back off the post, momentum swung in the All Blacks' favour.
The usually reliable De Klerk threw a loose pass and Mo'unga collected the ball to burst clear before being taken down by Makazole Mapimpi just short, although the South Africa winger was penalised for not releasing the All Blacks fly-half before competing for the ball on the ground.
The All Blacks were awarded a penalty instead of the penalty try captain Kieran Read wanted, but the defending champions then wrestled control of the game.
Sevu Reece skipped past opposite number Mapimpi moments later, in a move which ended with Beauden Barrett - who moved from full-back to first receiver on turnover ball - exploiting a gap in the Springbok defence to feed Bridge for the first try.
The All Blacks had their second try three minutes later when Anton Lienert-Brown cut back against the onrushing green shirts to pop the ball to Scott Barrett, who ran under the posts.
It was a five-minute blitz that took the game away from South Africa and reminded the rest of the world how clinical this All Black side are, despite losing their number one ranking coming into the tournament.
South Africa rue missed chances
South Africa are one of the contenders for the World Cup, and, on the evidence of their opening match, the 1995 and 2007 winners have the credentials to upset the defending champions.
When Du Toit picked up from the base of a ruck to run under the posts unopposed after the interval, the resurgent Springboks had their tails up, having reduced the deficit by 10 points.
Pollard's composed drop-goal brought them even closer, but despite making more metres (372) than the All Blacks (367), a higher penalty count (nine) and lack of cutting edge in attack will be a disappointment for Rassie Erasmus' side.
Winger Cheslin Kolbe has the potential to light the tournament up with his blistering pace and nimble footwork, but when he was stopped inches short of the line, he threw the ball away in an attempt to keep it alive rather than hold onto it.
New Zealand retrieved the loose ball and relieved pressure by running it the other way, but had the Springboks come away from that moment with a score, they would have set up a pulsating finale.
South Africa and the All Blacks will still be favourites to go through from Pool B, and with the draw structured as it is, we could have a replay in the final.
Man of the match - Beauden Barrett (New Zealand)
'It was a titanic struggle' - what they said
New Zealand coach Steve Hansen: "Today was a big game for both sides and fortunately for us we came out on top, but it was another titanic struggle between New Zealand and South Africa and hopefully people got excited by it. They're never out of it, they're always a team that comes back. The players took their opportunities and scored."
South Africa coach Rassie Erasmus: "They won it, I don't think we lost it. Two tries to one, they deserved to win the game. It's unbelievably well disciplined by them. That battle we lost. Discipline was our biggest downfall. I don't think we can really moan about anything, but just say well done to them."
Former New Zealand captain Tana Umaga told BBC Radio 5 Live: "Obviously New Zealand won't be totally happy with the performance. There will be things they want to work on. There's plenty to play for in these next three games."
Former Springbok international Bobby Skinstad told BBC Radio 5 Live: "Cheslin Kolbe made the decision to move out of sevens and play Tests. A lot of people said "bad idea", but he was the player of the season in France and the player of this match in green and gold."
New Zealand extend unbeaten run in pool stages - the stats
Teams
New Zealand: B Barrett; Reece, Lienert-Brown, Crotty, Bridge; Mo'unga, Smith; Moody, Coles, Laulala, Whitelock, S Barrett, Savea, Cane, Read (c).
Replacements: Taylor, Tu'ungafasi, Ta'avao, Tuipulotu, Frizell, Perenara, Williams, Smith.
South Africa: Le Roux; Kolbe, Am, De Allende, Mapimpi; Pollard, De Klerk; Kitshoff, Marx, Malherbe, Etzebeth, Mostert, Kolisi (c), Du Toit, Vermeulen.
Replacements: Mbonambi, Mtawarira, Nyakane, Snyman, Louw, H Jantjies, Steyn, Kriel.