Georgia Stanway's goal was England's 16th of the tournament, the second biggest haul in history.
CNN  — 

Trailing Spain 1-0 with six minutes of regular time left, England seemed to be exiting its home Women’s Euro until Ella Toone knocked home an equalizer that lifted a raucous, record crowd of 28,994 spectators inside the Brighton and Hove Community Stadium to their feet and dragged the quarterfinal to extra time.

Then, six minutes into the first extra period, Georgia Stanway was given an inch of space by the Spanish defense and fired the Lionesses into the semifinals with a sensational strike that sealed a 2-1 victory.

“That’s the shift from group mentality to knockouts. We’ve proved we’re resilient and can overcome tests,” England’s captain Leah Williamson told the BBC.

“Sorry to Mum and Dad that you have work tomorrow and I’ve delayed you returning home. I’m sorry to the whole nation, but I hope you’re buzzing like me.”

Leah Williamson celebrates her side's victory.

England’s Euro campaign had been flawless, topping its group without conceding a goal and achieving a record victory against Norway.

But Spain’s trademark tiki-taka passing ensured that it dominated the first half, starving the Lionesses of possession and any chance to unleash their free-flowing attack.

On 17 minutes, La Roja engineered its first shot on target as Mariona Caldentey curled in a shot from outside the penalty box which was scooped up by England goalkeeper Mary Earps.

Twenty minutes later, it looked as if Ellen White had scored for England against the run of play, prodding in a goal from a Lauren Hemp free kick, but her effort was ruled offside.

That sparked a late flurry of English attacks, but Spain’s defense held out and the first half ended goalless.

Spain began the second half brightly and took the lead when substitute Athenea del Castillo foiled Rachel Daly, zig-zagged into the box and set up Esther González who fired a goal into the corner of the net.

Spain celebrates Esther González's goal.

In response, England’s tactics shifted, and head coach Sarina Wiegman brought on Alessia Russo and Toone to stem Spain’s advance.

Earps’ outstretched fingertips deflected a powerful shot from Del Castillo to keep the Lionesses’ hopes alive before Russo and Toone combined on 86 minutes to equalize and push the match to extra time.

“We used Plan B,” Wiegman told the BBC. “We scored quickly after doing that so we could go back into our normal shape. I’m so proud of the team. The fans behind us, you could feel it. This is home advantage.”

After Stanway’s early goal in extra time, Spain continued to threaten but England held on to take a memorable win.

“It’s a disappointing defeat and disappointing to go out of the competition, but if there’s a good way to lose, it’s by playing as we did tonight. We gave everything, but it wasn’t to be. We’ve performed really well and there’s a bright future ahead, but it’s a difficult day for us,” Spain coach Jorge Vilda said, according to UEFA.com.

The Lionesses will now face either Belgium or Sweden for a place in the final.