Marta has been given the opportunity to see out her international career with a gold medal after fears that her Brazil career may have come to an ignominious end.
The legendary forward is Brazil's all-time leading goalscorer with 119 strikes to her name in an international career that began in 2002. She announced prior to this summer's Olympic games that the women's football tournament would be her last involvement for the national team.
That glittering career looked like it may have come to a sad end in Brazil's final group stage game, when Marta was shown a straight red card for a ludicrously high challenge that caught Olga Carmona in the head.
VIDEO Why Signing Archie Gray Was A Masterstroke By Spurs
Marta back from suspension for Brazil's Olympic final
Marta had to be consoled by teammates after being dismissed from the field, and subsequently lost an appeal against the two-man ban she was handed. Brazil also lost the game 2-0 to finish third in their group, but proceeded as one of the best third-placed sides.
That meant Marta missed Brazil's quarter-final and semi-final games, but they were able to eke past hosts France thanks to Portilho's late goal, then gained vindication over Spain with a comprehensive 4-2 victory. Brazil had led 3-0 going into the final five minutes of that game before a late flurry of goals.
Brazil will now face the United States at the Parc des Princes in Saturday afternoon's gold medal match - and Marta is now eligible for selection again.
Marta had said before the tournament began: “If I go to the Olympics, I will enjoy every moment because regardless of whether I go or not, this is my last year with the national team.
“There is a moment when we have to understand that the time has come. I am very calm about this because I see with great optimism this development that we are having in relation to young [players].”
The USA won all three of their games in a tough group that also contained Germany, Australia and Zambia, before beating Japan and Germany in the knockout stages. Both were 1-0 wins secured in extra time.
More Olympics stories
How to watch women’s Olympics football live streams from anywhere
Quiz! Can you name every nation to enter the men's football event at the Olympics?
Olympics 2024: What would a men's Team GB football side look like?