"It's a miracle, it truly is," said local fan Grygory Tarasov. "No one expected this. We have to work tomorrow, but it will feel like a holiday."
After the match Russians congregated in different areas around the capital, with huge crowds descending on Red Square.
The celebrations are likely to go on well into the night.
A special atmosphere had been building throughout the day leading up to the 5pm kickoff, though it felt more like a celebration of Russia's encouraging performance so far, as fans poured out of metro stations into the vast expanse of Luzhniki Stadium, rather than any genuine hope.
The national anthem was sung with tremendous vigour, and the chants of 'Rus-si-a, Rus-si-a' reverberated around the arena as the game kicked off.
But the noise diminished as Spain took a strangehold with their possession game, and grabbed the lead through a messy but deserved goal in the 12th minute.
Russia was limited to counter attacks, and the mood was demonstrated after half an hour, when the crowd began Mexican waves. But Russia's equaliser from the penalty spot – struck home confidently by 1.96m Artem Dzyuba – gave the local support renewed hope.
Spain laid seige to the Russia goal in the second half, with constant attacks but no cutting edge, and the crowd roared at the final whistle.
In the extra time period Russia gave up almost all pretence of trying to attack, with 11 men behind the ball and often camped inside their defensive third.
"This is not football," shouted one Spanish journalist nearby. "They are not even trying to play."
Maybe, but the defensive effort was superb, with the Russian back three trio of Ilya Kutepov, Sergey Ignashevich and Fedor Kudriashov immaculate with their positioning, physical strength and concentration.
Spain, who were playing a hybrid mix of the styles of Real and Athletico Madrid and Barcelona, weren't finding the mark with their crosses and were reluctant to shoot.
Russia's defensive approach was questionable – and made you yearn for the wonderful Soviet Union teams of the 1980s – but it was pragmatic.
On a humid evening, it was baking inside Luzhniki Stadium, with the partial roof trapping a lot of heat.
Valencia forward Rodrigo made an impact for Spain with his direct running, and La Roja wasted some late chances, as the Russian players urged more support from the crowd.
Penalties were always going to favour the home side, though Spain at least got the consolation of shooting toward their small band of supporters, probably less than one thousand.
But every Russian penalty was convincing, with even central defender Ignashevich striking home with aplomb.
Koke missed to ramp up the pressure on the 2010 World Champions, before Igor Akinfeev's freakish save of Iago Aspas' attempt sealed the victory for the Golden Eagles.
It was perhaps also appropriate that Spanish captain Sergio Ramos played a part in the Aspas's fateful miss. After converting the fourth penalty for Spain, the controversial Ramos had remained close to the penalty area, not retreating to the halfway line to stand with his teammates.
Just before Aspas was about to start his run up, referee Bjorn Kuipers noticed the presence of Ramos, and halted play. He waved Ramos back to halfway, as Aspas was forced to wait, never a good scenario for a penalty taker. And so it proved.