Alex Morgan scored in the final minute of extra time to send the United States into the Olympic final with a dramatic 4-3 win over Canada.
It was the United States who started the better, and they might have led inside five minutes when Megan Rapinoe struck from inside the box, but it drifted just wide.
The US continued to create the better chances in the early stages, with Morgan and Abby Wambach causing the Canadians problems with their attacking running.
Canada did grow into the half, however, with Christine Sinclair and Melissa Tancredi looking to link inside the opposition half.
Carli Lloyd was next to come close for the US after 16 minutes, but her strike was pushed away by Erin McLeod.
Canada took the lead with 23 minutes on the clock, however, when Sinclair danced into the box before finding the bottom corner. Morgan continued to go close for the US, and the striker headed just wide after 31 minutes.
The United States started the second period on the attack, but efforts from Morgan and Wambach continued to miss the target, while they had a host of penalty shouts turned down in the early stages.
They did eventually level after 54 minutes, however, when Rapinoe's corner somehow found its way into the back of the net.
The pressure continued to come from the US as the half developed, with Canada struggling to gain possession in the opposing half.
Sinclair sent Canada into the lead after 68 minutes when she scored her fifth goal of the tournament with a thumping header.
However, it was 2-2 three minutes later when Rapinoe struck a fine long-range effort into the bottom corner.
Sinclair was not content with her two strikes, however, and scored her third with another header from inside the penalty area after 73 minutes.
The match was level once more after 80 minutes when Wambach found the bottom corner from the penalty spot after Marie-Eve Nault had handled in the area.
The United States had a glorious chance to win it late on when Morgan found Wambach in the box, but she fired wide from close range as the whistle blew for extra time.
Tancredi came close for Canada five minutes into the extra period, but her effort from close range just missed the post, before Wambach tested McLeod down the other end.
Both teams made changes in the second period of extra time, and Wambach rattled the crossbar late on, but it was Morgan who won it in stoppage time with a header past McLeod.
The United States will face Japan in the final on Thursday.