Megan Rapinoe scored twice from the penalty spot and the United States overcame a costly mistake and a strong performance from Spain in a 2-1 win to advance to the World Cup quarterfinals.
Team USA will face host France on Friday at 3 p.m. ET at Parc des Princes in Paris.
Rapinoe gave the U.S. another early lead with a penalty kick in the 7th minute after Tobin Heath was taken down in the box with a hard foul.
But two minutes later a pass to Alyssa Naeher to Becky Sauerbrunn in traffic was dispossessed by Jennifer Hermoso, who leveled the score with a quick curling effort to beat Naeher and end a scoreless streak for the Stars and Stripes that had stretched to 646 minutes.
With the game very much on going into the second half, the United States were able to ground out a nail-biting 2-1 win that was set up by another foul in the box, this time for soft contact on Rose Lavelle. Alex Morgan initially lined up to take the spot kick but after VAR confirmed the penalty, Rapinoe ended up stepping up to the spot to make it 2-1 in the 76th minute.
Carli Lloyd, Christen Press and Lindsey Horan were all brought in late to see off the rest of the 90 and seven minutes of stoppage time in what ended being a gritty win and advance kind of game against a Spain team every bit deserving of making their first Round of 16 appearance. Julie Ertz returned to the lineup after missing the final group game and went the full 90 in central midfield.