Canada stunned the United States on Monday to hand them a shocking 1-0 defeat in the semi-finals of the women's Olympic football tournament to set up a date with Sweden in Friday's final.
The Swedes beat Australia 1-0, thanks to a 46th-minute goal from Fridolina Rolfo to return to the final after their silver medal in Rio five years ago.
Canada celebrated their first win over the US in over 20 years after Jessie Fleming's 75th-minute penalty settled the contest.
The crucial moment, in a game that had produced little incident, came when US defender, Tierna Davidson, challenged Deanne Rose on the edge of the penalty area.
After a video review, a spot-kick was awarded.
Canada's veteran striker, Christian Sinclair, initially had the ball in her hands, but Fleming took the responsibility and kept her cool to slot home.
The US pre-Games favourites for the gold medal, went close to an equaliser when Carli Lloyd struck the bar with a header but Canada held on for a famous victory and their first appearance in an Olympic final.
The Americans have won the gold medal four times and have not lost to Canada for over 20 years.
It is only the fourth time the Canadians have beaten their neighbours in 62 meetings.
"It has been a long time coming to beat those guys.
"We want to come away with gold now but it is really special for us to put our flag on the map," said Fleming.
The game was a dull affair until a triple substitution saw Megan Rapinoe, Lloyd and Christen Press brought on – a change which brought new life to the American attack.
The first effort on goal finally arrived in the 65th minute with a curling shot from Lloyd which was tipped over by Stephanie Labbe, and moments later the Canada keeper did well to keep out a glancing header from Julie Ertz.
But just as the Americans were piling on the pressure, a Canada break led to the penalty award and the end of the road for Vlatko Andonovski's side.
"It sucks. Obviously you never want to lose, you never want to lose in a world championship, you never want to lose to Canada, obviously, and you never want to lose playing the way we did," said Rapinoe.
Sweden, who lost to Germany in the Rio final, fired an early warning with a Rolfo shot rattling the crossbar.
Australia, seeking a first Olympic final, thought they had gone ahead just before the break with a Sam Kerr effort but the goal was ruled out for a foul.
It was the Swedes who took the lead when Matilda's keeper Teagan Micah could only push a looping, deflected shot from Filippa Angeldal against the bar and Rolfo hooked in the loose ball.
Australia were reduced to 10 players in stoppage time when Ellie Carpenter was sent off for pulling down Sweden substitute Lina Hurtig as she ran goalwards.
"It is amazing, I am so happy. I think we learnt a lot from this game, we worked so hard as a team and we will have to bring that to the final.
"It feels like I am in paradise. I love to play with this team, we have a great team spirit," said Angeldal.
Kerr said she was disappointed with the ruling out of her goal.
"Obviously, we are disappointed because we wanted to be in the gold medal match but at the end of the day, we have got a game against the U.S and the bronze medal is at stake," she said.
The bronze medal game will be played in Kashima on Thursday with the gold medal match at the Olympic Stadium in Tokyo on Friday.
The men's semi-finals will be played on Tuesday with Mexico taking on Brazil and Japan up against Spain.