Spain's Pau Gasol had 10 points and 11 rebounds to spark the reigning European champions into the Olympic men's basketball semi-finals on Wednesday with a 66-59 victory over France.
The Spaniards, silver medallists in 2008, will play Russia, an 83-74 winner over Lithuania, in a semi-final game on Friday with that winner advancing to Sunday's gold medal championship match.
Later quarter-final matches will see the US NBA Dream Team face Australia and Brazil face Argentina.
France led 53-50 entering the fourth quarter but Spain moved ahead quickly on an inside shot by NBA big man Serge Ibaka and a blocked shot by NBA star Gasol that set up a fast break dunk by Sergio Llull for a 58-57 Spain edge with 5:35 remaining.
Rudy Fernandez added two free throws with 91 seconds remaining to boost Spain's lead to 60-57 and on the next possession both Fernandez and Gasol blocked shots to force a a shot-clock violation turnover from France.
That set up a layin from Marc Gasol, who led his team with 14 points, to give Spain a 62-57 lead with 45 seconds remaining.
French NBA standout Boris Diaw missed a 3-point attempt and Marc Gasol grabbed the rebound and Spain hit free throws down the stretch to seal France's fate.
Juan-Carlos Navarro was shoved on a hard intentional foul by France's Nicolas Batum with 23 seconds to play, one that touched off harsh words and nearly more between the players before cooler heads prevailed.
NBA stars Diaw and Tony Parker each scored 15 points to lead France.