Wales 12-6 South Africa

Wales finally cracked the code of success against major southern hemisphere opposition as full-back Leigh Halfpenny's relentless goalkicking saw off Millennium Stadium visitors South Africa.

Halfpenny kicked four penalties to give Wales victory over South Africa, Australia or New Zealand for the first time since November 2008, ending a run of 22 successive defeats.

Wales' 12-6 triumph was only their second in 30 attempts against the Springboks, and a first for 15 years, as they bounced back from losing to world champions New Zealand last weekend.

It will send them into February's RBS 6 Nations opener against England with topped up confidence levels, while they also gained a slight psychological edge ahead of a possible World Cup quarter-final appointment with South Africa next October.

Although the game was not a free-flowing spectacle, Wales deservedly prevailed after digging deep into their stamina reserves and shading the key physical battles.

The Wales scrum enjoyed an outstanding afternoon and South Africa could make little headway, frustrated by a lack of quality possession that meant they could not unleash dangerous runners like full-back Willie le Roux and centre Jan Serfontein.

There were few attacking openings for either side, but Wales controlled the critical moments and kept their composure when the heat came on, giving Wales boss Warren Gatland one of his finest moments since he took charge seven years ago.

And to complete a miserable afternoon for South Africa, whose points came through two Pat Lambie penalties, they saw captain Jean de Villiers carried off midway through the second half after suffering what appeared to be a serious leg injury.

Gatland made three changes from the side beaten by the All Blacks seven days ago, with Liam Williams replaced concussed wing George North, while there were also starts for prop Gethin Jenkins and hooker Scott Baldwin.

South Africa, having recovered from a European tour opening loss against Ireland three weeks ago by beating England and Italy, were led by De Villiers, but absentees included wing Bryan Habana, prop Jannie du Plessis and flanker Francois Louw.

Wales made a touching tribute to Australian cricketer Phillip Hughes, who died earlier this week, by leaving a lone cricket bat outside their dressing room as they prepared to enter the arena, before a minute's silence was observed in memory of Hughes and Ireland's 1948 Grand Slam star Jack Kyle.

Halfpenny and Lambie exchanged penalties during the opening 10 minutes, but a second Halfpenny attempt then struck the post, frustrating the home side as they hoped to make their early territorial dominance count.

There were few clear-cut attacking opportunities early on, with both sides relying heavily on their respective kicking games, but South Africa lock Eben Etzebeth was fortunate to escape a yellow card following a high challenge on Wales fly-half Dan Biggar.

Wales continued to press, with Williams chasing a well-placed kick into space, and South Africa's defensive structure started to be tested approaching the end of an opening quarter that saw the Springboks under comfortably more pressure than their hosts.

Wales, in an attempt to convert pressure into points, twice opted for 13-man lineouts, with only Baldwin and scrum-half Rhys Webb not involved as they camped close to South Africa's line.

But such clever thinking outside of the box did not reap a reward, and South Africa moved upfield to create a sustained spell of pressure, forcing Wales into defensive mode.

South Africa enjoyed dominance during the dying minutes of the first half but they could find no way through either, and Wales trooped off facing a final 40 minutes of their autumn campaign that would undoubtedly prove to be a survival of the fittest.

Both sides came out with plenty of intent as the second half swung into action, but it was Wales who regained the lead through Halfpenny's second successful penalty after South Africa were punished for not releasing possession.

Irish referee John Lacey kept a vice-like grip on the contest and there was no leeway for either team, and the Springboks quickly drew level through another Lambie strike, this time from 50 metres to make Wales' lead a short-lived business.

Defences continued to dominate and South Africa conceded another penalty after they tried to run possession from deep inside their 22. Such adventure backfired when tighthead prop Coenie Oosthuizen infringed and Halfpenny completed his penalty hat-trick.

That was the cue for Springboks head coach Heyneke Meyer to make a double substitution, sending on prop Trevor Nyakane instead of Tendai Mtawarira and replacing flanker Teboho Mohoje with Nizaam Carr.

As the third quarter neared its conclusion, South Africa were still encountering problems breaching Wales' defence, and then a mighty Welsh scrum had the Springboks in all sorts of trouble and Halfpenny's fourth successful penalty made it 12-6 before Springboks wing Cornal Hendricks was sin-binned for a dangerous challenge on Halfpenny.

And the closing stages were all about a survival of the fittest, but Wales dug deepest as they finally ended their southern hemisphere hoodoo.