- Salma Paralluelo (81')
- Olga Carmona (89')
- Rebecka Blomqvist (88')
Wearing the captain's armband, Carmona's 90th-minute strike from the edge of the area pinged off the crossbar and into the net two minutes after Rebecka Blomqvist had levelled the match for Sweden in front of a baying crowd of 43,217 at Eden Park.
Teenager Salma Paralluelo, Spain's quarterfinal hero against the Netherlands, produced magic off the bench again, putting her side in front in the 81st minute and breathing life into what had been a slow-burning, cagey affair.
Peter Gerhardsson's Sweden bow out after another defeat at the penultimate hurdle, having made the semifinals in France four years ago and at last year's European Championship.
"It felt like a punch in the stomach when they managed to take the lead again straight away. There are no words," Sweden defender Magdalena Eriksson told Swedish radio.
"I'm incredibly disappointed, we gave everything we had, we even managed to equalise. We fought against a headwind today, we didn't succeed."
Fifteen Spain players had threatened to quit last year if coach Jorge Vilda was not moved on, but on Tuesday his decision to replace playmaker Alexia Putellas with Paralluelo before the hour mark proved decisive.
In a match-up of Iberian attacking flair and Swedish defensive resilience, Spain were the livelier side early on but had nothing to show for it.
Full back Carmona blazed just wide with a low, long-range effort in the 14th minute and midfield dynamo Aitana Bonmatí thrashed a wild shot past the same right post from the edge of the area.
However, Sweden finished the half ascendant with a typical salvo of set-piece pressure.
But the Sweden winger's volley was well covered by goalkeeper Cata Coll.
Sweden kept up the heat after the break but Paralluelo, named player of the match, wrested back the momentum for the Spaniards.
She came close to breaking the deadlock in the 70th minute when she kept the ball alive with a cut-back pass to Alba Redondo in close. Slumped on the turf, Redondo swung a leg out but could only put her shot into the side netting.
Eleven minutes later Paralluelo pounced again on a poor clearance, thumping home into the right corner to send Spanish fans into delirium.
It appeared all over for Sweden as regulation time dwindled but Lina Hurtig headed down to an unmarked Blomqvist, who volleyed home from close range.
The Swedes' joy quickly turned to despair when Carmona's fierce strike was tipped onto the underside of the bar by goalkeeper Zecira Musovic before bouncing down over the line, ensuring Spain create more history at their breakout World Cup.
"I think everyone just feels sadness and huge disappointment," Sweden boss Gerhardsson told reporters.
"We felt this enormous joy and elation that maybe we can bring this to extra time. Then it turned again."
Host nation New Zealand bid a fond farewell to the tournament, having generated a total attendance of more than 700,000 people in 29 matches across four cities.
- Edina Alves Batista