Koke had his penalty saved early in the shootout, giving Russian Federation the advantage, and then Igor Akinfeev saved Iago Aspas' spot kick with his foot to send his side into the last eight and send Spain home from the tournament.
Akinfeev's penalty heroics led goalkeeping great Peter Schmeichel to say that the Russian Federation 'keeper "deserves a statue" in his honor.
Spain made 1,137 passes and completed 1,029, according to Federation Internationale de Football Association.
Spain, who have never beaten a host at World Cups or Euros, went ahead after 12 minutes when 38-year-old Sergei Ignashevich bundled into Spain captain Sergio Ramos at the far post, knocking a free kick in with his heel for the 10th own goal of the tournament.
Russian Federation pulled off one of the biggest upsets in World Cup history after beating Spain 4-3 on Sunday at the packed Luzhniki Stadium. "We were hoping for penalties and that's what happened, thank God", the keeper said. Some will criticise them for playing with such little ambition, but Russia's defensive play was extraordinary. That run was ended days later by a Spain team beginning its era of dominance. We are leaving this World Cup without losing a single match, and that is a fact.
Russian goalkeeper Igor Akinfeev made a diving save to tip away Andres Iniesta's powerful shot from the top of the area and got to his feet immediately to block Iago Aspas' shot from the deflection with five minutes to go in regulation.
Just as he did after Russia's 5-0 win over Saudi Arabia in the group stage, President Vladimir Putin called Cherchesov to congratulate the team on reaching the quarter-finals, according to Kremlin spokesman Dmitry Peskov. "We did everything we could to try to win the match".
Oil prices rise on supply losses, US push to isolate Iran
The US president tweeted within an hour of OPEC announcing its deal: "Hope OPEC will increase output substantially". That would limit Opec's ability to react to further disruptions - and there are plenty coming.
In overtime, Spain has created a few more chances, but Akinfeev played correctly.
"At that time, Spanish teams were favourites, but as we say in Russian Federation, anyone can be god if he tries to", he said. And frankly, had the ball not gone in, Spain might have been given a penalty for what looked like a foul.
Aspas almost picked out Carvajal with a cut-back, seconds into the start of extra time, which saw Aleksandr Erokhin come on as Russia's fourth sub - the first time the rule has been applied at the World Cup.
Fyodor Kudryashov will join Sergei Ignashevich and Ilya Kutepov in the center of defense, with Mario Fernandes and Yuri Zhirkov on the flanks.
Before the game, he had compared Russia's qualification from the group stage to a fairytale, and the fans echoed that with a vast banner reading: "You were born to make the fairytale real".
As rain came down, each team made its first two kicks in the shootout, but Akinfeev dived right and with a two-handed punch stopped Jorge "Koke" Resurreccion.