REIMS, France (AP) - Spain tested the United States like no other team at the Women's World Cup.
The U.S. looked disorganized at times facing Spain's aggressive and physical style before pulling out a 2-1 victory Monday night.
It could have been just what the Americans needed: France is waiting.
Megan Rapinoe converted a pair of penalty kicks to set up the United States' much-anticipated quarterfinal rendezvous with the hosts.
The tense match was knotted at 1 until Rapinoe's second penalty put the defending champions ahead in the 75th minute.
"I think we showed just a lot of grit and experience, to be honest, in this game," Rapinoe said. "Obviously as we get into these knockout rounds it's more stressful, there's more pressure, the games are more intense. Every team lifts its level."
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, spoiling Spain's spirited effort in its first knockout-round appearance at a World Cup.
The three-time World Cup winners now 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.
"I think this is the game that everyone had circled," Rapinoe said, referring to France. "I think it's going to be a great matc."
The game 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. Until Monday, the Americans had not allowed a goal in eight straight competitive matches dating 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.
"This tournament isn't supposed to be easy and Spain was a great team," midfielder Samantha Mewis said. "I think these are the kinds of things that let us know that we're strong and that we can grind through something. So I think we're gonna take a lot from this and it gives us a lot of faith in ourselves."
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 last 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 pushed the U.S. hard 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 the review Rapinoe stepped forward and slotted the ball just under the outstretched arm of Spain goalkeeper Sandra Panos.