Spain is seeking a second straight trip to the Olympic gold-medal game.
Russia hasn't won a medal of any kind since NBA players became regular participants.
The Russians can end that drought and prevent the Spaniards from playing for gold again as these nations meet in the semifinals Friday in a rematch of a thrilling pool-play contest.
Spain put aside what has been an uneven Olympics by winning 66-59 over France on Wednesday, closing on a 12-2 run over the final 6:50 thanks to some outstanding defense.
"We still have to find our flow, we still have to find our best game offensively. But I like the way we were competing today," said Pau Gasol, who is averaging 18.8 points to rank fourth in the tournament.
Spain had dropped its previous two games to finish third in Group B, including a 77-74 loss to Russia on Saturday. The Russians clinched the group title with that victory.
Russia beat Lithuania 83-74 in its quarterfinal Wednesday. Andrei Kirilenko scored 19 points and Timofey Mozgov added 17.
"This was a big step for our country, for our basketball," forward Sergei Monya said.
Spain lost to the United States in the 2008 Beijing Games gold-medal contest after winning the world championship two years earlier. The Spanish team also has captured the last two EuroBasket titles to further establish itself as one of the best in the world.
Russia hasn't medaled in the Summer Games since the former Soviet Union captured gold at Seoul in 1998, the last tournament which didn't include NBA players. This will be its first Olympic semifinal appearance since a Unified Team of former Soviet republics lost to Lithuania in the 1992 bronze-medal contest.
The Russians have won their last two meetings at major tournaments against Spain, also winning the 2007 EuroBasket title with a memorable 60-59 victory in the championship in Madrid. Kirilenko was named tournament MVP.
Spain built a 20-2 lead in Saturday's meeting against Russia and led by nine with under 4 1/2 minutes left before faltering down the stretch. Gasol missed the first of two free throws with 5.2 seconds left and his team down by two.
Reserve Vitaliy Fridzon scored 24 points to lead Russia in that contest, which marked Spain's first Olympic loss to a team other than the United States since 2000. Anton Ponkrashov added 14 points while Kirilenko was held to eight on 2-of-8 shooting.
Gasol led Spain with 20 points, with nine coming after the first quarter. Guards Jose Calderon, Juan Carlos Navarro and Rudy Fernandez combined for 21 points on 7-of-22 shooting.
Navarro and Fernandez were victimized by hard fouls by the French in the closing moments Wednesday, but both seem to be OK.
"Everyone wants to fight for those medals, and sometimes it gets a little out of hand because emotions get involved," said Marc Gasol, who led Spain with 14 points. "Nobody gets hurt, that's the most important thing."