World champions South Africa ended a run of four successive away defeats against Wales by claiming a dramatic 23-18 victory at the Principality Stadium.

It was the Springboks’ first win in Cardiff since 2013, but they did not secure it until substitute hooker Malcolm Marx scored a 73rd-minute try and Elton Jantjies kicked a penalty.

Despite being without injured captain Alun Wyn Jones and a host of other absent British and Irish Lions, Wales delivered a towering performance, with fly-half Dan Bigger kicking six penalties.

Liam Williams is tackled after jumping over a pitch invader Liam Williams is tackled after jumping over a pitch invader (David Davies/PA)

Biggar’s sixth successful penalty put Wales back in front at 18-15, although there was drama just a minute earlier when the hosts attacked through Liam Williams just as a spectator ran on to the pitch only a few metres away from him.

Williams had to jump over the pitch invader before he was duly led away, although Wales would not have scored.

Handre Pollard kicked four penalties and Frans Steyn one for South Africa, yet Wales bounced back superbly from a 54-16 drubbing against New Zealand last weekend.

And their outstanding performer was flanker Ellis Jenkins, who suffered a major knee injury against the Springboks three years ago and had not played Test rugby since.

Wales were without Jones, while other unavailable Lions included Ross Moriarty, Ken Owens, Justin Tipuric and George North, with centre Jonathan Davies taking over as skipper.

South Africa made three switches from the side that beat New Zealand last month, with full-back Damian Willemse, wing Jesse Kriel and scrum-half Herschel Jantjies all featuring behind an unchanged pack.

Wales made a bright start and shaded the early possession, with Biggar mixing his running and kicking game impressively before wing Louis Rees-Zammit was denied a try by brilliant Springboks cover defence.

Louis Rees-Zammit is tackled short of the line by South Africa’s Siya KolisiLouis Rees-Zammit is tackled short of the line by South Africa’s Siya Kolisi (David Davies/PA)

Biggar kicked Wales into the lead through a 10th-minute penalty, but Pollard landed an equalising strike two minutes later as persistent drizzle swirled around the stadium.

Biggar restored Wales’ advantage through a second penalty, while South Africa saw Willemse go off for a head injury assessment as Steyn joined the action.

A tight opening quarter reached its conclusion with South Africa showing an early sign of scrum dominance and Pollard kicking a second penalty to make it 6-6.

South Africa attempted to launch their main ball-carriers at Wales, but the home side defended superbly, with Jenkins at the forefront.

Referee Paul Williams speaks to South Africa’s Siya Kolisi Referee Paul Williams speaks to South Africa’s Siya Kolisi (David Davies/PA)

Biggar completed his penalty hat-trick 13 minutes before the break, and referee Paul Williams’ growing impatience at South Africa’s poor technical discipline saw him engage in a lengthy conversation with Springboks skipper Siya Kolisi.

South Africa then saw prop Ox Nche yellow-carded for obstruction on Tompkins, and Biggar’s fourth successful penalty opened up a six-point advantage.

But even though Wales had prop Rhys Carre sin-binned for a technical infringement, they deservedly claimed a 12-9 interval lead after Pollard landed a third penalty.

South Africa sent on a replacement front row of Steven Kitshoff, Marx and Vincent Koch just five minutes after the restart as they looked to establish a foothold in the game.

Dan Biggar impressed with the boot Dan Biggar impressed with the boot (David Davies/PA)

Wales were forced into a defensive rearguard, but they tackled and harried magnificently before breaking away, forcing South Africa to infringe, and Biggar kicked a 45-metre penalty.

It was a stirring effort by the home side, and although the Springboks looked more threatening in attack than during the first half, it required a 52-metre penalty from Steyn for their next points.

South Africa, however, had other ideas, breaking into Wales’ half from 70 metres out, but wing Makazole Mapimpi had a try disallowed, and the home side retained their narrow advantage before Marx struck following a relentlessly-driven lineout, but Elton Jantjies missed the conversion.

Jantjies final kick penalty, though, meant South Africa sealed the deal and finally broke Welsh resistance.

Wales: McNicholl; Rees-Zammit, J Davies (capt), Tompkins, Adams; Biggar, T Williams; Carre, Elias, Francis, Rowlands, Beard, Jenkins, Basham, Wainwright. Replacements: Roberts for Elias (70) W Jones for Jenkins (42-45) for Carre (68), John for Francis (60) Carter for Jenkins 78, S Davies for Wainwright (54), G Davies for T Williams (68), Anscombe for Biggar (68), L Williams for J Davies (60), J Davies for Tompkins (78). Sin-bin: Carre (35).

South Africa: Willemse; Kriel, Am, de Allende, Mapimpi; Pollard, H Jantjies; Nche, Mbonambi, Nyakane, Etzebeth, De Jager, Kolisi (capt), Smith, Vermeulen. Replacements: Marx for Mbonambi (45), Kitshoff for Nche (45), Koch for Nyakane (45), Mostert for de Jager (60), Wiese for Kolisi (70), Reinach for H Jantjies (53), E Jantjies for Pollard (65), Steyn for Willemse (13). Sin-bin: Nche (30).

Match officials: Referee: Paul Williams (NZR). Assistant Referees: Andrew Brace (IRFU) & James Doleman (NZR TMO: Olly Hodges (IRFU).