Brazil will meet the United States in the final of the Olympic women's soccer tournament after beating world champion Spain 4-2.
Gabi Portilho and Adriana struck at Stade de Marseille after an own goal from Irene Paredes had put the two-time silver medalist in an early lead.
Victory means Brazil great Marta should get the chance to end her glittering international career by competing for gold after being suspended for the quarterfinals and semifinals.
The 38-year-old Marta has said her sixth Olympics will be her last major tournament with the national team.
Spain won't get the chance in Paris to further cement its place at the top of women's soccer by adding Olympic gold to the World Cup it won last year.
Paredes' sixth-minute own goal put Brazil in control and Portilho doubled the advantage in the fourth minute of first-half stoppage time.
Adriana's header in 71st underlined Brazil's dominance.
Salma Paralluelo pulled a goal back for Spain with a header in the 85th and almost .