Handre Pollard slotted a penalty with four minutes remaining to send South Africa into the Rugby World Cup final after a nail-biting 19-16 win over Wales on Sunday.

Pollard and Wales' Dan Biggar exchanged penalty after penalty in an agonizingly tight game at International Stadium Yokohama, before South Africa looked to have gained a decisive advantage when Damian de Allende crashed over for a try in the 57th minute.

Wales hit straight back as Josh Adams touched down in the corner for his tournament-leading sixth try of the World Cup, sending the game into the final 10 minutes poised on a knife-edge with the score tied.

But Pollard broke open the deadlock with another penalty in the 76th minute to send the Springboks into their first World Cup final since 2007, where they will play England, the team they defeated 15-6 on that occasion to lift the Webb Ellis Cup for a second time.

"They strangle the life out of the opposition," South Africa head coach Rassie Erasmus said of Wales, which had beaten the Springboks in each of their last four encounters. "Today we expected exactly that and that's what we received. We had to match that. It probably wasn't the best spectacle to watch but we expected that. The boys stuck to their guns and adapted.

"We've given ourselves a chance. I think we've played England four times in the last 18 months, and I think it's 2-2. We had three test matches in South Africa and then the last one in Twickenham, so we are accustomed with the way they play. They are obviously much better than the last time we played them. You could see it last night, the way they dismantled New Zealand. But we think we are in with a chance."

Wales was attempting to reach the final for the first time, having lost in the semifinals in both 1987 and 2011. Instead, head coach Warren Gatland will lead the team for the last time in the bronze-medal match against his native New Zealand in Tokyo on Nov. 1, before stepping down after 12 years in charge.

"It was a tough encounter," said Gatland. "We knew it was going to be an arm-wrestle. There was a momentum shift in the last four or five minutes and we tried to keep going, but unfortunately we were penalized and then the game has gone away from us. I'm not taking anything away from South Africa, I thought they played really well tonight.

"There wasn't a lot of flowing rugby played. We tried to move the ball a little bit in the first half, and then once we were in that arm-wrestle, it was about attrition. I'm very proud of the boys in terms of never giving up and staying in there. With a little bit of luck and the bounce of the ball, maybe things would have been a bit different."

Pollard opened the scoring for South Africa with a penalty in front of the posts in the 14th minute, before Biggar returned fire for Wales with one from a much more difficult position four minutes later.

Pollard kicked South Africa back in front within minutes, then slotted another penalty in the 35th minute to widen the gap to six points.

Wales suffered a setback when winger George North pulled up with a hamstring injury while chasing a Biggar kick to the corner just before halftime, and had to be replaced by Owen Watkin. Biggar landed another penalty as Watkin was preparing to come on, however, and Wales went into the break only three points behind.

Biggar's boot drew Wales level five minutes after the restart, but South Africa prized the game open with the first try of the evening. The Springboks worked the ball out left after Wales had repelled wave after wave of attack, but De Allende found a gap as he crashed through several tackles to touch down.

Pollard landed the conversion to ease South Africa further in front, but Wales hit straight back, camping out on the Springboks' line before releasing Adams to dive over in the corner. Leigh Halfpenny slotted a huge conversion from the touchline to tie the game up again.

Rhys Patchell missed a drop goal attempt as both teams looked for whatever would give them the slenderest advantage with the match inside the final 10 minutes, and Pollard found it, dispatching his penalty to send South Africa into the final.

"It means a lot to me and the team," said South Africa captain Siya Kolisi. "We work really hard — all of us in the team. The coach gave me my first contract when I was 18 years old so I've known him for a while. He's coached all the guys. He knows us and he's there to pull us together, and we buy into his plan.

"As soon as he came in, he made it clear that the Springbok is the most important thing, whereas in the past I think most of us tried to build ourselves through social media. He has brought us back to earth and told us we have to play well and everything else will come. It's awesome to see it all come together."