Spain striker lvaro Morata reached the Euro 2020 quarter-finals in a breathless match with storylines, responding to criticism for helping fire his team to a 5-3 win over Croatia after extra time on Monday went.
In the best game of the tournament so far, Spain trailed Pedri's own goal from near the halfway line after an unbelievable error from keeper Unai Simon in the first half.
But the three-time European champion regained her balance and was on her way to a comfortable victory with goals from Pablo Sarabia, Cesar Azpilicueta and Ferran Torres.
Showing the spirit that carried them in the last World Cup final, Croatia made a surprise comeback in the 85th minute with a goal from Mislav Orcic and staged a Mario Pasalic header in extra time to force an extra period.
Luis Enrique's side, however, showed tremendous character and won with a brilliant strike from Morata in the 100th minute and a goal from Mikel Oyarzabal in the 103rd minute.
Spain celebrated their first knockout win in a major tournament since winning Euro 2012, reaching the quarter-finals against France or Switzerland in St Petersburg on Friday.
Spain defender Cesar Azpilicueta said: "We've suffered a lot, it's been such a long time since we won the knockout matches and we managed to do it against the World Cup runners-up."
"We scored two goals in seven minutes but in extra time we were better than them and we deserved to go through."
Captain Sergio Busquets also praised his side's mentality and defended Simon, who compensated for his first-half disaster with a brilliant defense to thwart Andrej Kramaric and prevent Croatia from taking the lead in extra time.
"Unai knows he's got all our confidence. The target was bad luck but he has a calm mind and is ambitious and he showed today. He was extremely safe after the goal and made some top saves," said Busquets.
"When Croatia changed their system, they filled the pitch up and we didn't adjust quickly. But overall I'm very happy with the result, how we handled the extra time and the fact that we're in the quarter-finals. "
Croatia are headed home with their heads up but still waiting to win a knockout game at Euros.
Morata has been at the center of Spain's campaign amid inconsistent performances and criticism from his own supporters, which took an ugly turn during last week's 5-0 win over Slovakia.
His wife and children were threatened by supporters in Seville and he complained of facing death threats before the game, prompting coach Luis Enrique to call for police action.
Morata has been accused of a fragile temper, but showed steel when the Spaniard's confidence was on the floor, controlling Dani Olmo Cross with one leg before exploding into the ceiling of the net.
Substitute Oyarzabal struck moments later to extend Spain's lead and this time Croatia had no reaction.
The result made them the first side at Euros to score five or more goals in consecutive matches, with Morata joining Fernando Torres as his country's joint-highest scorer in the competition on five goals.
Pedri earned an unwanted record: his own goal from 49 yards was the longest own goal at Euros and the first goal of the tournament from outside the box.
