Igor Akinfeev was Russia's hero after saving two penalties in a shootout to sensationally dump Spain out of the World Cup and book the hosts a place in the quarter-finals after a 1-1 draw in Moscow.
Koke and Iago Aspas were denied by the Russia goalkeeper as 2010 champions Spain, who dominated possession without creating clear chances, were defeated 4-3 on penalties.
Sergei Ignashevich became the oldest scorer of an own goal in World Cup history when the 38-year-old gave Spain an early lead at the Luzhniki Stadium.
A right-wing Isco cross isolated Ignashevich and Sergio Ramos at the back post, the Russia defender turning the ball home via his heel as he desperately tried to block his opponent's run.
But Russia drew level in the 41st minute, Artem Dzyuba smashing home a penalty after his header was blocked by Gerard Pique's arm in the box.
A stodgy Spain could not break the hosts down and were denied a penalty following a VAR review in extra-time, sending the tie to a shootout.
Akinfeev saved a terrible Koke penalty to put Russia in control and with David de Gea unable to stop any of the four kicks he faced, Aspas' effort was brilliantly blocked by the goalkeeper to spark chaotic celebrations.
live on!The Luzhniki has exploded into a sea of celebrations. The hosts are into the quarter-finals!July 1, 2018
Aleksandr Golovin's early break down the right raised excitement levels among Russia's loud following, but his cross was blocked and Aleksandr Samedov's resulting corner was too deep.
Spain then took the lead from a more accurate set-piece in the 12th minute.
Isco's free-kick from deep on the right saw Ignashevich grappling with Ramos at the back post, the ball inadvertently bouncing past Akinfeev off the veteran defender's heel, although Spain's captain tried to claim the goal.
Spain were dominating possession but complacency edged into their game and the next big chance fell to Russia in the 36th minute, Golovin bending a shot wide after Dzyuba held off Ramos to win a header.
And Russia were then gifted a penalty when Pique handled in the box.
Dzyuba - whose header was blocked by the defender's arm - crashed home from 12 yards to send the sides into half-time level after Akinfeev did well to deny Diego Costa.
Seven shots facedSix goals concededNot the numbers David De Gea is used to...July 1, 2018
Jordi Alba and Costa missed efforts after the restart as Spain tried to increase their tempo.
Russia coach Stanislav Cherchesov could smell a major upset, introducing Villarreal midfielder Denis Cheryshev, who hit three goals in the group stage, while Spain sent for Andres Iniesta, who had started 21 consecutive matches at international tournaments.
And it was Iniesta who almost came up with the winner in the 85th minute, Akinfeev getting down low to his right to save, the goalkeeper then denying Iago Aspas on the rebound.
Akinfeev claimed Pique's header and pushed away a Rodrigo Moreno shot in extra-time, while the introduction of Aleksandr Erokhin as Russia's fourth substitute made World Cup history.
Pique and Ramos both appeared to be held from a set-piece but, after a VAR check, referee Bjorn Kuipers waved away Spain's desperate appeals.
1000 - Spain are the first team to attempt 1000+ passes in a World Cup game since at least 1966. Style.July 1, 2018
Host nations had won each of their last four shootouts and when Akinfeev easily kept out a tame Koke effort, Russia were on track for one of the biggest shocks in World Cup history.
De Gea's miserable World Cup was complete as he was beaten by all four Russia penalties, piling the pressure on Aspas, who saw his effort diverted away by the leg of home hero Akinfeev.
Russia's first win over Spain since the breakup of the Soviet Union books the hosts a place in the quarter-finals, where either Denmark or Croatia await.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.