As the South Africans celebrated, fulltime left Wales players doubled over or on their knees, hearts broken yet again by the Springboks. But the Welsh could be proud of their contribution, without virtually a full backline of injured stars.
They should have had a try in the first three minutes. Rookie center Tyler Morgan stripped counterpart Damian de Allende and began a counterattack which put the ball in the hands of prop Gethin Jenkins. He had the foresight to see Morgan unmarked on the far right, but threw a high miss-out pass that missed everyone.
South Africa was under pressure for three more minutes, until No. 8 Toby Faletau was penalized for not releasing on the 22, and the Boks cleared.
In the next 10 minutes, Springboks first five-eighths Handre Pollard landed three penalties and his Welsh oppposite Dan Biggar kicked one.
The Springboks led 9-3, and just when it appeared they might be getting away, Wales produced a try from nothing. Du Preez hit a clearing kick straight down the middle to Biggar, who launched an up and under back into South Africa's quarter.
Willie le Roux over-ran it and Biggar regathered, then passed with defenders all around him to halfback Gareth Davies, who beat the cover to the right of the posts.
Biggar converted for 10-9 and a first Welsh lead.
It lasted three minutes, until another penalty from Pollard.
The second quarter was played between the 22s, South Africa edging possession and Wales defending all across the field and forcing turnovers. Captain Sam Warburton was superb.
With a minute left in first-half regulation, Biggar booted a penalty from 47 meters which hit the right upright. They forced a scrum and, in injury time, Jamie Roberts straightened the attack, and Biggar was perfectly set up to land a dropped goal for a 13-12 lead at halftime.
Pollard finally missed a goalkick to start the second half, while Biggar extended Wales' lead with a penalty from 46 meters and room to spare. When Leigh Halfpenny was injured and out of tournament reckoning, Wales was said to have lost a long-range goalkicker because anything over 40 meters was supposed to be beyond Biggar's range. But the Welsh No. 10 has well and truly ended that notion and enhanced his reputation.
He also can tackle. He made big, move-stopping tackles on center Jesse Kriel on the left side, and Bryan Habana on the right.
Meanwhile, Pollard kicked a dropped goal to cut the deficit to one, and his fifth penalty just after the hour gave South Africa the lead again at 18-16.
Moments later, of course, Biggar landed his third penalty goal to regain the lead at 19-18 with 16 minutes to go.
The teams reloaded with replacements, and Biggar reluctantly left the field in the 74th for a head injury assessment. His pain was aggravated a minute later when du Preez scored the winning try.
South Africa 23 (Fourie du Preez try; Handre Pollard 5 penalties, dropped goal), Wales 19 (Gareth Davies try; Dan Biggar 3 penalties, conversion, dropped goal). HT: 12-13.
-AP
Match stats
Chalkboard
Action areas