Wales will play France in the Rugby World Cup quarterfinals after laboring past Uruguay 35-13 to top Pool D on Sunday.

Four wins from four matches gave the Welsh a pool sweep for the first time since 1987. Their victory left Australia to play England in another quarterfinal.

Coach Warren Gatland gave 11 Wales players their first starts in the tournament and said he'd consider them for the quarterfinals team if they impressed, but few impressed in a match they dominated but kept hurting themselves through unforced errors.

Wales' Ryan Elias is tackled by Uruguayan defenders during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. (AP PhotoAaron Favila)

Wales' Ryan Elias is tackled by Uruguayan defenders during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. (AP PhotoAaron Favila)

In the face of Uruguay's scrambling, scrappy defense, Wales could score only four legitimate tries and received a penalty try.

Two more tries were ruled out on video review, and three others were bombed. Winger Hallam Amos had three ruled out, all of them his own fault.

The fumbling and bumbling meant Uruguay was in the match at halftime, behind only 7-6. While the Teros never looked like winning, they hustled to the end and managed to humble the Welsh by scoring their only try while down to 14 men.

Wales' Aaron Wainwright is tackled by defenders during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. (AP PhotoAaron Favila)

Wales' Aaron Wainwright is tackled by defenders during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. (AP PhotoAaron Favila)

Gatland wanted the Teros out of the picture long before halftime so he could rest some tired players four days after the bruising comeback against Fiji. He was justified to think his players would deliver as Wales won the only previous matchup 54-9, but the players were sloppy in dry conditions.

Three catches were dropped in the first four minutes; one by No. 8 Aaron Wainwright with the line at his mercy. Flanker Aaron Shingler had a try ruled out for a foot in touch.

Uruguay was dicing badly with the offside line under sustained pressure and down to its last warning from referee Angus Gardner when Wales prop Nicky Smith, after 14 phases, burrowed over with Bradley Davies on his back in the 17th minute.

Wales' Tomos Williams scores a try during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. (AP PhotoAaron Favila)

Wales' Tomos Williams scores a try during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. (AP PhotoAaron Favila)

But only Uruguay added points in the rest of the half as flyhalf Felipe Berchesi kicked two penalties for them to trail only 7-6.

Wales finally made separation from a lineout: Parkes battered the line, Davies was stopped under the crossbar and Rhys Patchell's miss-out pass put Josh Adams in.

For the second time in the match, Amos bombed a try when he took a final pass in front of Parkes, earning scathing looks from Leigh Halfpenny.

Wales' Gareth Davies runs in to score his team's final try during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. Wales defeated Uruguay 35-13. (AP PhotoAaron Favila)

Wales' Gareth Davies runs in to score his team's final try during the Rugby World Cup Pool D game at Kumamoto Stadium between Wales and Uruguay in Kumamoto, Japan, Sunday, Oct. 13, 2019. Wales defeated Uruguay 35-13. (AP PhotoAaron Favila)

Uruguay flanker Santiago Civetta's yellow card for a professional foul opened the way for a Wales penalty try from a rolling maul and 21-6.

But the Teros were inspired to push hooker German Kessler over from a ruck.

Wales hit back immediately with a try by replacement scrumhalf Tomos Williams, and Amos bombed a third try when he dived into the left corner but dropped the ball.

The teams went back and forth after the final hooter, and five minutes in replacement flyhalf Gareth Davies settled with a quick tap to himself and a try between the posts.

More AP Rugby World Cup: https://www.apnews.com/RugbyWorldCup and https://twitter.com/AP_Sports