The host nation's Euro 2004 dreams are still alive - and our men in Portugal witnessed emotional scenes as Spain were seen off 1-0.
First a taste of the atmosphere in the Jose Alvalade stadium - then scroll down for how victory was celebrated in Porto.
By Phil McNulty
BBC Sport in Lisbon
If England's Wayne Rooney and the classic Czech Republic win against Holland had given Euro 2004 its footballing heartbeat, this was the game that made the tournament come alive emotionally.
Portugal had been on the back foot since Greece punctured all the optimism with a shock win in the opening game.
But there was new spring in the step of Euro 2004 as the streets of Lisbon were grid-locked by fans sounding car horns and hanging perilously out of windows and sun-roofs as they sped down the motorway.
The steep stands of Sporting Lisbon's home rocked at the final whistle with the double helping of good news that Portugal had reached the quarter-finals - and in doing so had sent old adversaries and neighbours Spain back across the border never to return.
Supporters started arriving four hours before kick-off, with the thousands of Spanish fans making this the most memorable atmosphere of Euro 2004 so far.
It was a cacophony of noise that reached a deafening crescendo in injury time as an entire country pleaded with the referee - that old peroxide showboater himself Anders Frisk - milking every second, to blow the final whistle.
The flags that have been flying around Portugal had been somewhat limp in appearance since defeat to Greece, but in the joyous chaos of victory, they were suddenly in full sail and the nation had been transformed.
Cristiano Ronaldo - never a man to use one step-over when six will do - summed it up: "We knew all of Portugal was behind us tonight. We have done it for the country and now we want to go as far as we can."
Portugal's footballing icon Luis Figo, perhaps remembering he had to return to Spain and
Real Madrid, was more diplomatic.
"I would have liked Spain to have gone through, but it was not to be and we have to be happy for ourselves."
It was a message that will have fallen on deaf ears as Portugal celebrated.
This was a night when even impartiality was cast aside, with Portuguese journalists holding scarves aloft as the national anthem was played - a gesture that was well-rewarded.
The streets of Lisbon were packed through the night
And central to the win was the naturalised Brazilian Deco, who has won Champions League honours with Porto, is understood to be Chelsea-bound, but whose inclusion was
greeted with cynicism even by his fiercely patriotic team-mates.
He won the man of the match award for a lung-busting performance in midfield, but had rivals in the Maniche and Costinha, who provided the hard-running foil for the wing play of the veteran Figo and Ronaldo.
Figo provides the experienced old head, carrying his country's hopes, while Ronaldo has the young legs and the pace that will frighten any opponents.
It was a night of pure sporting theatre that left Figo, a relic from Portugal's so-called "golden generation" dreaming of silverware at Euro 2004.
And on the noisy streets of Lisbon, a nation that feared an embarrassing exit in the group stages, could suddenly see hope of the ultimate victory on home soil.
By Paul Fletcher
BBC Sport in Porto
There was only one thing that mattered in Portugal on Sunday.
Since their team beat Russia to set-up a must-win encounter with deadly rivals Spain,
this football crazy nation had been thinking of nothing else.
Evidence of it was everywhere and there seemed to be nothing else on television on
Programmes were broadcast live from outside the ground in Lisbon as the networks
battled to win the Euro 2004 ratings war.
It seemed that just about every Portuguese person within a mile of the Estadio Dr
Magalhaes Pessoa was asked for their opinion of the game as the hours ticked down to
One particular TV channel, Directo, pulled no punches and in mid-afternoon was
broadcasting scenes that would have had middle England choking on their Sunday roast.
Thousands of fans congregated in Porto's Praca de Don Joao I
A studio full of topless women wearing only miniscule Portuguese flags as skirts and a modicum of paint on their chests, danced to samba music and chanted "PORT-U-GAL" over and over again.
And the director made sure that the watching audience saw more than their fair share of the dancers' prime assets.
In Porto the match was broadcast on several large screens dotted around the city.
Praca de Don Joao I was packed two hours before kick-off, hawkers were doing a brisk trade in every possible kind of merchandise and everyone wore the red, yellow and green national colours.
But the party atmosphere was more than tinged with an over-riding sense of anxiety.
Against their deadliest rivals, most Portuguese fans were braced for defeat.
One fan, who called himself Deco, said: "The first game against Greece was a disaster, the second much better but against Spain, I fear the worst."
His friend, who went by the name of Luis, added: "To me this game is life."
Both had their faces coloured in the Portuguese colours, as did hundreds of other, and
the two teenage girls responsible for painting the faces had a harassed look.
The first images of the teams taking to the field were greeted with chants of "Portugal
ole, Portugal ole" and every glimpse of a Spaniard elicited a chorus of boos.
By the time the national anthems were played, not only was the square packed to capacity but so were the surrounding roads and the police had to constantly move hundreds of the watching crowd to allow buses to carry on their way.
With Portugal dominating the opening stages, the crowd cheered every corner, every piece of skill and - especially - every chance Spain missed.
By half-time, with the game goalless, anxiety levels were reaching meltdown
- but this sense of sheer desperation and pent up frustration transformed itself into an extraordinary eruption of joy when Nuno Gomes scored.
The elderly seemed to lose about 20 years, mums and dads embraced and teenagers
thrashed around as though they had lost control of their motor skills.
A tangible sense of self-belief surged through the crowd and they willed their team to victory.
The closing minutes seemed to last an age, with each supporter living every moment of
the action as though they were out there on the pitch.
But referee Anders Frisk finally ended their torture and the mass hysteria began.
Doubtless many Portugal fans went to work on Monday nursing sore heads.
But they would not have it any other way.