The host nation held firm through 90 minutes against Spain.
Sergei Ignashevich's own goal pushed the Spanish in front early on, but Artem Dzyuba converted a penalty to pull the host nation back level.
Russia stayed level from then on, pushing the 2010 World Cup champions to a 1-1 draw through regular time while making all three permitted changes.
But the 2018 World Cup, for the first time in history, has made an allowance for a fourth substitute for teams in extra time, and Russia became the first side to make use of the rule when Aleksandr Yerokhin was brought on in the 97th minute.
Russia has been forced to defend gallantly, with Spain setting a World Cup record for passes completed in a match and the home side running themselves ragged as they closed down one Spanish attack after another.
Spain joined in making a fourth sub soon after the Russians, Rodrigo entering the match for Marco Asensio, as the favourites looked to add some fresh punch to their attack.
Even with the two changes in extra time, 120 minutes wasn't enough to separate the two sides, who were forced to go to penalties to find a winner, with Russia taking the victory from the spot and sending Spain out of the World Cup.