Olga Carmona's stunning late 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 semi-final 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.
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, principally 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 in which 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.
Spain coach 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 yet neither Putellas nor Aitana Bonmati was allowed the time and space to really influence the game.
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 an impressive 2-1 win 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 beginning to tire, and it was just before the hour mark that he turned to the former athlete.
Paralluelo took the place of 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 following a cross by Hermoso, 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.
But Sweden did not give up, drawing 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 once again.
But Carmona, the Real Madrid left-back, had other ideas as she clinched victory for Spain in style. (AFP)