Spain beat Russia 67-59 to reach the Olympic men's basketball final for the second successive time.
Spain will meet either 2008 champions United States or 2004 Olympic winners Argentina in Sunday's gold medal game, while Russia will play for the bronze.
Outplayed in the first half, 2008 Beijing silver medallists Spain dominated play over the last 20 minutes, outscoring the Russians 47-28 to erase an 11-point deficit at the break.
Pau Gasol led Spain with 16 points, while Jose Calderon posted 14 points, all but two of them coming in the second half.
Sasha Kaun was top scorer for Russia with 14 points.
Spain, the 2008 silver medallists, had a miserable time scoring in the first half, shooting a consistently woeful 21 percent, making 3-of-15 shots in the first quarter and 3-of-14 in the second quarter.
Russia began the game doing their offensive damage inside and then found their shooting touch in the second quarter on a 10-0 run to build a 27-14 lead before finishing the half leading 31-20.
A revived Spanish team hit the floor after the break, playing with more quickness and defensive intensity.
A Calderon three-pointer at the buzzer tied the game 46-46 at the end of the third quarter and European champions Spain continued their energised play through to the end to book another appearance in the gold medal game.