Olga Carmona's stunning 89th-minute strike gave Spain a 2-1 win over Sweden on Tuesday to propel them into the Women's World Cup final for the first time in their history.
Spain's thrilling victory at Eden Park sets up a showdown in Sydney on Sunday with either Australia or England, who meet in the other semi-final on Wednesday.
The last-four clash in Auckland seemed to be drifting towards extra time before suddenly bursting to life when substitute Salma Paralluelo put Spain ahead with nine minutes left.
Rebecka Blomqvist equalised for Sweden in the 88th minute only for full-back Carmona, Spain's captain, to score with a superb shot in off the underside of the crossbar from the edge of the box 60 seconds later.
"We are so proud of everything we have done and for getting to the final because now we are one small step away from glory," said Paralluelo.
It has been a remarkable run for a nation who had never previously gone beyond the last 16 at a Women's World Cup, and for a team who had been in disarray in the months leading up to the tournament.
Fifteen Spanish players told their federation last September that they no longer wished to be considered for selection, mainly out of unhappiness with coach Jorge Vilda, and only three of them returned for this World Cup run.
While their dream of World Cup glory remains alive, Sweden are left with a familiar feeling after going so far at another major tournament before falling short.
This is the third time in four World Cups that they have reached the semi-finals, only to lose on each occasion.
Peter Gerhardsson's side also lost in the last four at the European Championship last year, having been beaten in the final of the Tokyo Olympics on penalties against Canada in 2021.
"Everyone just feels sadness and huge disappointment," said Gerhardsson, whose team had been so impressive in beating Japan 2-1 in the last eight.
"We were up against an excellent Spanish side and they were able to disrupt us a lot more than Japan did."
- Super-sub Paralluelo -
Vilda decided against handing a start to Paralluelo, after she came off the bench to score the winner in the quarter-final against the Netherlands.
Instead he recalled Alexia Putellas and the reigning Ballon d'Or winner started for the first time since Spain were walloped 4-0 by Japan in the group phase.
The plan was clearly to dominate possession and make a more physically imposing Sweden do the chasing.
Spain had far more of the ball in the first half but the closest they came to breaking the deadlock was from long range when Jennifer Hermoso laid the ball back to Carmona, whose shot whistled wide.
Sweden had taken the game to Japan in the quarter-finals but they offered next to nothing here until suddenly they almost struck three minutes before half-time.
Nathalie Bjorn sent a hanging cross from the right to the back post for Fridolina Rolfo –- facing seven of her Barcelona club colleagues in the Spain starting line-up -– but her side-foot volley was saved by Cata Coll.
Vilda's plan was clearly to save the pacy Paralluelo for when the Swedish defence was tiring, and it was just before the hour mark that he turned to the former athlete.
Paralluelo replaced Putellas, who has still not completed 90 minutes at this World Cup as she continues to recover full fitness following a serious knee injury.
The substitute's persistence almost brought the opener for Spain with 20 minutes left as she stretched to keep the ball in play, but Alba Redondo turned her cutback wide.
Paralluelo then struck with nine minutes of normal time remaining, showing a killer instinct to lash a shot low into the corner.
Sweden drew level in the 88th minute thanks to two substitutes of their own.
Lina Hurtig had only just come on when she nodded down a cross for Blomqvist to fire home, raising the spectre of extra time.
But Carmona, the Real Madrid left-back, had other ideas as she clinched victory for Spain in style.
as/pst