South Africa's Springboks were made to come from behind to beat Scotland 30-17 at the Mbombela Stadium in Nelspruit on Saturday and set up a match against Samoa next weekend.
The Springboks trailed 6-10 at half time and needed a penalty try and Scotland to lose a player to the sin bin before they took the lead in the 60th minute for the first time.
The visitors Scotland fielded an almost third string team due to injuries and British and Irish Lions call ups but still scored the only try of the first half by centre Matt Scott and captain Greig Laidlaw added a conversion and a penalty.
The Springboks' first half points came courtesy of flyhalf Morne Steyn, who converted two penalties.
Overall the Springboks display was disjointed and the final score flattered the hosts. South Africa will now play Samoa in the final of the series in Pretoria next weekend.
At the start of the match, the South Africans were surprised by a much-improved performance from Scotland who tested their defence.
The Springboks suffered an early injury blow when flanker Arno Botha was wheeled off the field in the fourth minutes, for what appeared to be a knee injury. His departure saw Siya Kolisi receive his first Springbok cap.
The livewire flanker made a strong showing on debut, making a few strong runs with the ball in hand and put in some hard tackles.
The Scots were rewarded for their spirited assaults on the gain line, coming away with the first points of the match as captain Greig Laidlaw succeeded with a penalty in the seventh minute.
Laidlaw, playing in his first Test as captain, was damaging around the fringes and caught the South Africans sleeping.
Springbok flyhalf Morne Steyn levelled the scores in the 13th minute and added another three points five minutes later to put South Africa in the lead.
It was short-lived as Scotland pierced the Springboks' defence on the 20-minute mark with centre Matt Scott finding easy passage past the South African defenders to score, with Laidlaw converting.
While the Scots were threatening on attack, the hosts were rather toothless and they looked generally disjointed.
As the teams went into the change rooms for the half-time break, Scotland held on to a four-point advantage over the Springboks.
Scotland struck another psychological blow shortly after the restart as outside centre Alex Dunbar touched down in the 43rd minute. Laidlaw converted to extend his team's lead to 11 points.
The Boks' fortunes started to turn in the 49th minute when referee Roman Poite awarded a penalty try against Scotland for collapsing a maul near the try line, with Steyn converting.
Poite's whistle again favoured the Boks three minutes later when Scotland lock Jim Hamilton was yellow-carded for taking a swipe at Eben Etzebeth.
South Africa took full advantage of having an extra man with JJ Engelbrecht scoring his five-pointer in the 55th minute.
Fullback Willie le Roux showed his worth as he pulled in defence and gave a well-weighted pass to Engelbrecht to finish, with Steyn converting to give South Africa a three-point lead.
With 15 minutes left, Springbok coach Heyneke Meyer sent on some fresh legs using almost his entire bench at the same time.
Bismarck du Plessis and Coenie Oosthuizen replaced Adriaan Strauss and Tendai Mtawarira followed shortly by Patrick Lambie, Jan Serfontein, Piet van Zyl and Trevor Nyakane.
Lambie opened his account in the 75th minute with a penalty conversion to take South Africa's score to 23-17.
The Boks finished the match with a final flourish as Serfontein scored his team's third five-pointer of the evening. Lambie converted for a flattering final score of 30-17
Final Score South Africa 30 (6) Scotland (10) 17
Tries - Penalty Try, JJ Englebrecht, J.Serfontein
Pen - M.Steyn 2, Lambie
Con - M.Steyn 2, Lambie
Tries - M.Scott, A.Dunbar
Pen - G.Laidlaw
Con - G.Laidlaw 2
Drop - J.Hamilton (Yellow)
Referee: Romain Poite (FRA)
Willie le Roux; Bryan Habana, JJ Engelbrecht, Jean de Villiers (capt), Bjorn Basson; Morne Steyn, Ruan Pienaar; Pierre Spies, Arno Botha, Marcell Coetzee; Juandre Kruger, Eben Etzebeth; Jannie du Plessis, Adriaan Strauss, Tendai Mtawarira
Replacements: Bismarck du Plessis, Trevor Nyakane, Coenie Oosthuizen, Flip van der Merwe, Siya Kolisi, Piet van Zyl, Patrick Lambie, Jan Serfontein
Peter Murchie; Sean Lamont, Alex Dunbar, Matt Scott, Tommy Seymour; Ruaridh Jackson, Greig Laidlaw (capt); Johnnie Beattie, Ryan Wilson, Alasdair Strokosch; Jim Hamilton, Tim Swinson; Euan Murray, Scott Lawson, Alasdair Dickinson
Replacements: Stevie Lawrie, Jon Welsh, Moray Low, Alastair Kellock, David Denton, Henry Pyrgos, Peter Horne, Duncan Taylor