Spain, who have never beaten a host at World Cups or Euros, went ahead after 12 minutes when Sergei Ignashevich bundled into Ramos at the far post, knocking a free kick in with his heel for the 10th own goal of the tournament.
Spain then lost the penalty shootout with Iago Aspas and Koke both denied by Russian Federation goalkeeper Igor Akinfeev.
Their quarter-final opponents will be decided on Sunday night, when Croatia face Denmark in Nizhny Novgorod.
In fact, Spain needed a weird own goal by the otherwise excellent Sergei Ignashevich to open the scoring, while Russia's equaliser was another penalty, this time a 41st-minute effort by Artem Dzyuba.
Spain took a 12th-minute lead when veteran Russian Federation defender Sergei Ignashevich put into his own net, but Artem Dzyuba equalised by scoring a penalty for the hosts in the 42nd minute after Gerard Piqué handled in the area. "Sometimes the end is not as you dreamed it".
Spain had managed a shutout in each knockout game of their victorious 2010 campaign, including extra-time in the final, and that sequence was broken by Artem Dzyuba's penalty conversion.
That was the last drama of extra time and with thunderstorms providing a fittingly dramatic soundtrack, the match went all the way to penalties. We don't like this type of structure with three central defenders but they trusted me and I spoke with every player individually. Referees and video officials have consistently penalised handballs in the box at this World Cup.
In addition to scoring the World Cup's winning goal in 2010, Iniesta had also been key for Spain when it won the 2008 and 2012 European Championships with its tiki-taka style modeled on Barcelona's ball-possession game.
Spain subs: Daniel Carvajal, Andres Iniesta, Saul Niguez, Rodrigo Moreno, Thiago Alcantara, Lucas Vazquez, Alvaro Odriozola, Kepa Arrizabalaga, Cesar Azpilicueta, Nacho Monreal, Iago Aspas, Pepe Reina.
Spain join Germany, Argentina and Portugal as the fancied teams eliminated.
Russian Federation coach Stanislav Cherchesov claimed he had to "persuade" his players to switch to the five-man defence that frustrated Spain and helped the hosts reach the last eight of the World Cup.
Four years ago in Brazil, Geiger took charge of Chile's 2-0 win over Spain and Colombia's 3-0 victory against Greece in the group stage, and France's 2-0 win over Nigeria in the round of 16.