REIMS, France — The U.S. women will have Spain to thank if they win their fourth World Cup trophy.

After breezing through the group stage, the Americans were finally tested – really tested – in a 2-1 win Monday that showed them what shortcomings they'll need to address if they're going to reach the July 7 final.

Forget the final. The U.S. is going to have to sharpen up before Friday's quarterfinal match against host France if they hope to keep playing.

"Honestly it’s a big character builder for us – and something that’s really going to help us moving forward in this tournament," said Rose Lavelle, who was fouled in the box in the 71st minute, setting up the game-winning penalty kick by Megan Rapinoe.

Spain is the 13th-ranked team in the world, and was playing in its first World Cup knockout game. Yet it went toe-to-toe with the Americans, giving future opponents an idea of ways to rattle the defending champions. Press high and hard, and play aggressively. Go after a defense that is the weak spot everyone thought it might be.

Most importantly, don’t back off and make the Americans work for everything they get.

“If they had to win through penalties, it’s because we’ve shown our worth and we’ve given them a run for their money,” Spain coach Jorge Vilda said.

Now it’s on the Americans to make sure no one else does.

The U.S. is the gold standard in women's soccer, with the titles and accolades to prove it. It's a three-time World Cup champion and, and a four-time Olympic gold medalist, and it came into the tournament as the No. 1-ranked team in the world.

OPINION:USWNT wins on a soft penalty — but it was 100% the right call

UP NEXT:U.S. faces perhaps biggest threat in France

USWNT RANKINGS:1999 World Cup team still the best — for now

Its dominance in the group stage was impressive, scoring a record 18 goals and recording three shutouts. With so much depth it could afford to bring players of Carli Lloyd and Christen Press’ caliber off the bench, it seemed unlikely that anyone could match up with them – especially with France struggling in its last three games and Germany slow to get into a rhythm.

But while the Americans still have to be considered the team to beat, their invincibility is no longer a given. The picture of them now is much fairer than after those routs of vastly overmatched Thailand and Chile.

And that is not a bad thing.

No championship team wins a title without a few bumps, and the Americans weren’t going to be the exception. Four years ago, the U.S. was sluggish throughout the group stage. At the 2012 Olympics, they needed a rarely called penalty for time wasting by the goalkeeper to get through the semifinals.

And in 2008, they actually lost their first group-stage game.

It happens. But if a team can rebound and use the poor performance as fuel to become stronger, then so much the better.

If the U.S. winds up lifting the trophy on July 7, this game is just one part in the journey rather than the spot where the Americans fell off the cliff.

“It was a lot of grit, lot of resolve. That mental piece,” coach Jill Ellis said. “You can have all the tactics in the world, but that essence of self-belief, that’s critical. And these players have that.”

The biggest concern for the U.S. remains its defense. Goalkeeper Alyssa Naeher had been considered the glaring weak spot, having never started in a major tournament and not having the swagger and intimidation factor of Hope Solo or Briana Scurry.

Those concerns were validated in the ninth minute, when Naeher tried to make a shockingly short pass to Becky Sauerbrunn. Spain is known as a high-press team and, sure enough, Sauerbrunn couldn’t get rid of it fast enough with Lucia Garcia closing in.

The ball popped loose, and Jennifer Hermosa pounced on it. Her shot went above Naeher’s outstretched arm, tying the game at 1.

“I just tried to do a little bit too much,” Naeher said. “I probably shouldn’t have played that ball into a pressure pocket. Probably a little bit smarter decision to play it a little bit higher up the field.”

But the response was telling.

Naeher was solid the rest of the game, and Ellis, Rapinoe and several others said one play, in the opening minutes of the game, wasn’t defining of anything.

“Those moments can absolutely destroy a team or unravel a team,” Ellis said. “The mental capacity and strength of this team, they parked it and moved on, and that’s what you have to do in those moments.”

A team doesn’t really know how strong it is until it’s tested. The U.S. finally has been and, victory aside, it’s the best thing to come out of this win.

Follow USA TODAY Sports columnist Nancy Armour on Twitter @nrarmour.