REIMS, France — Megan Rapinoe converted a pair of penalty kicks and the United States set up a much-anticipated quarterfinal meeting with host France at the Women's World Cup with a 2-1 victory over Spain on Monday.

Rapinoe's first came in the seventh minute to the cheers of the U.S. supporters melting in temperatures that reached nearly 90 degrees at the Stade Auguste-Delaune. They were quieted a short time later when Jennifer Hermoso tied it up for Spain with the first goal the Americans had allowed in France.

Video review was used to confirm a foul on Rose Lavelle that gave the pink-haired captain the game-winner in the 75th minute, spoiling Spain's spirited effort in its first knockout-round appearance at a World Cup.

The defending champions head to Paris to face France on Friday night. The French defeated Brazil 2-1 in extra time Sunday night, with Amandine Henry scoring the game-winner in the 107th minute.

A meeting between the three-time World Cup champions and the hosts at the home of Paris Saint-Germain has been anticipated since the tournament draw in December. France is vying to become the first nation to simultaneously hold both the men's and women's World Cup titles. The French men won in Russia last year.

The United States skated through its group with a stage record 18 goals. And the team didn't concede a goal in the group stage for the first time at a World Cup.

Until Monday, the Americans had not allowed a goal in eight straight competitive matches dating back to the 2016 Olympics, outscoring opponents 44-0. It was the first goal the United States had allowed this year since a 5-3 win over Australia in an April friendly.

La Roja had not scored in its previous two games but still finished second in its group to Germany to get the matchup with the Americans.

The U.S. and Spain met in a friendly in Alicante in January, part of a European exhibition trip for the United States. Christen Press scored the lone goal in a 1-0 victory. That match was a confidence-booster for No. 13 Spain because it was able to hang with the world's top-ranked team. Spain's profile on the international stage has grown under coach Jorge Vilda, who took over following the team's World Cup debut in 2015. Spain won the 2017 Algarve Cup and last year won the Cyprus Cup.

Spain gave the U.S. all it could handle on Monday.

Rapinoe's first penalty kick was the result of Maria Leon's tackle on Tobin Heath after a pass from Abby Dahlkemper.

Less than three minutes later, goalkeeper Alyssa Naeher's pass to Becky Sauerbrunn was stripped by Lucia Garcia and the ball wound up at the feet of Hermoso, who sent her shot from the penalty arc into the top right corner. It was Hermoso's third goal of the tournament to lead Spain.

Alex Morgan was set to take the penalty after Lavelle was tripped up by Virginia Torrecilla, but after review Rapinoe stepped forward and slotted the ball just under the outstretched arm of Spain goalkeeper Sandra Panos.

Morgan, who leads the field in France with five goals, took a beating throughout the game. She stayed down for a long while in the second half after a hard tackle by Irene Paredes.

Coach Jill Ellis did not start midfielder Lindsey Horan, replacing her with Samantha Mewis. Horan, who came in as a sub in the 89th minute, had a yellow card in the team's second match.

Rapinoe collected a yellow card in the 37th minute against Spain. The cards could become an issue for the United States against France. Players who accumulate two through the quarterfinals must sit out the next game.

Ellis coached her 124th match with the U.S., matching April Heinrichs for most in the team's history.