The United States came through a testing last-16 tie against Spain to set up a tantalising Women's World Cup quarter-final against France.

The world's number-one side and pre-tournament favourites were given a scare by the Spaniards but survived the first nervy match of their title defence with a narrow win thanks to two penalties.

Megan Rapinoe's early goal from the spot gave the USA the lead but Spain hit back when Jennifer Hermoso capitalised on a defensive mix-up to equalise brilliantly.

Jill Ellis' side were awarded another penalty in a tense second half, with the decision standing after a lengthy review from the VAR officials; Spain unhappy at what they saw as the soft nature of midfielder Rose Lavelle's tumble in the box.

Rapinoe held her nerve to fire in from the spot for a second time and ensure the holders will face the hosts in Paris on Friday, in what promises to be one of the games of the competition.

A potential semi-final against England could follow, with the winner of the Lionesses' quarter-final against Norway in Le Havre on Thursday set to meet the victors from the USA and France's clash.

Relief for the favourites

Mapi Leon (left) tripped up Tobin Heath which resulted in Megan Rapinoe's opener

The three-time champions were made to work hard for their last-eight spot, and briefly gave their fans reason to fear they might not extend their record of having always at least reached the semi-finals.

There was a shocked reaction when Hermoso levelled for Spain, as the USA conceded for the first time this summer, having gone 648 minutes of football without letting a goal in since April.

And the USA, who have only lost once since 2017, looked slightly vulnerable in defence under pressure from an improving Spanish outfit.

Nevertheless, the holders created the better chances and were once again strong going forward, with Rapinoe denied by a near-post save in the first half.

The game's decisive moment came as Lavelle poked the ball beyond Virginia Torrecilla in the area and went down.

Hungarian referee Katalin Kulcsar initially awarded the spot-kick without hesitation, before taking a further look at the replay following guidance from her VAR colleagues. She opted to stick with her original call, much to the frustration of the Spain fans at a passion-fuelled Stade Auguste-Delaune.

Brave Spain go home with pride and frustration

USA striker Alex Morgan (left) was well marshalled by the Spanish defence

On a hot and humid evening in Reims, Ellis' formidable USA squad were made to sweat by one of the world's improving teams.

Spain - labelled as 6-1 outsiders for this tie by some bookmakers, with the USA 1-10 on - had caused problems as early as the first minute, when Patri Guijarro's shot was blocked by Becky Sauerbrunn.

Playing in only their second World Cup and having reached the knockout stages for the first time, they were led from the back by resolute Paris St-Germain defender Irene Paredes, while Atletico Madrid star Hermoso played a key role in building their counter attacks.

Having finished second in Group B behind Germany, the side ranked 13th in the world will leave France with their heads held high, but with a tinge of frustration at the decision to award the USA's second penalty.

The first spot-kick - which came when Mapi Leon brought down Tobin Heath - was comparably clear cut, but opinions were divided on the significance of the contact made with Lavelle for the crucial second.

Boos rang around the stadium as Spain's fans expressed their dismay at the outcome of the VAR review, but Rapinoe - who replaced Alex Morgan as the USA's penalty-taker during the long pause for the review - was nerveless.

'We were the equals of the world's best team' - what they said

USA head coach Jill Ellis: "There's not flawless soccer to be found in this world. That's part of the game.

"We knew we could be sharper in the final pass, but Spain are a very good team.

"This was a really tricky game - probably the hardest in the last 16. It was good and it has energised our players."

Spain manager Jorge Vilda: "On the pitch, I really feel that we should all be very proud of what we did. I am very proud.

"In terms of competitiveness we've been able to be the equals of the best team in the world. We've been able to give them a run for their money.

"We are a national team that - at the end of the day hasn't walked away with a prize - but we have shown our potential for growth."

'There are so many things to question'

Former United States keeper Hope Solo on BBC Radio 5 Live: "I don't know where to begin. There are so many things to question. You don't always get a perfect win, sometimes it's ugly and sometimes it's hard-fought, which I understand as a player. But at the same time when you have that much attacking prowess, to not get a goal in normal play is concerning. It was two penalties and one I didn't even think was a penalty, and if it was, it was soft.

"If you want to beat the USA you have to press the backline. That's where they are truly vulnerable. It's the decision making, it's the quality of passing and I think there are nerves back there. I don't think they are good enough to keep possession."

USA on the spot again - stats

USA have reached the quarter-final stage in every edition of the Women's World Cup between 1991 and 2019; the second nation to achieve this feat alongside Germany (eight).

Spain have won just one of their seven matches at the Women's World Cup (W1 D3 L3), with this their first defeat and match in the knockout stage.

Only Germany (13) have scored more penalties (excluding shootouts) than USA (11). This is the second Women's World Cup match in which USA netted two penalties (also 26 June 2003 v Nigeria).

Rapinoe is just the second player to score two penalties in a single Women's World Cup match after Hermoso v South Africa (also at the 2019 edition).

Hermoso scored her first open play goal at the 2019 Women's World Cup, with what was her 13th such attempt Hermoso is Spain's leading scorer in WWC history (three)

Rapinoe has been directly involved in 12 goals in her 15 appearances at the Women's World Cup (six goals, six assists).

BBC Sport has launched #ChangeTheGame this summer to showcase female athletes in a way they never have been before. Through more live women's sport available to watch across the BBC this summer, complemented by our journalism, we are aiming to turn up the volume on women's sport and alter perceptions. Find out more here.