Canada's Jessie Fleming scored a penalty kick in the 75th minute to reach the country's first Olympic soccer final, guaranteeing at least a silver medal. The U.S. will have to settle for the chance to win bronze in a third-place playoff Thursday.
American defender Tierna Davidson committed a foul in the penalty area and Fleming calmly stepped up to score the goal. U.S. goalkeeper Adrianna Franch, brought on as a substitute for the injured Alyssa Naeher, guessed correctly and dived to her left, narrowly missing the ball. The penalty was only awarded after a video assistant referee check.
"Not our best game, not our best tournament," star midfielder Megan Rapinoe said after the game. "It's a bitter one to swallow, obviously we don't want to lose to Canada.
"We just couldn't figure it out on the field. I don't know exactly what it was but, yeah, but this certainly not one of our better performances."
While the team "hadn't had our joy a little bit" during the Games, there was still much to play for with an Olympic medal still up for grabs, Rapinoe added.
Neither side dominated in a cagey, tentative first half, the 84 degree heat and 85 percent humidity making for tough conditions for both teams.
U.S. coach Vlatko Andonovski made three changes to the team that beat the Netherlands in the quarterfinal. Alex Morgan started in attack instead of Carli Lloyd, Rose Lavelle replaced Sam Mewis in midfield and defender Davidson came in for Abby Dahlkemper.
Australia plays Sweden in the remaining semifinal later Monday.
Download the NBC News app for breaking news and politics
The U.S. had more energy and drive after making three attacking substitutions on the hour mark, with neither goalkeeper having made a save.
Rapinoe then forced a smart save from Canadian goalkeeper Stephanie Labbe on 68 minutes after a period of sustained U.S. pressure and a string of corner kicks, but still the breakthrough proved elusive.
The U.S. could not covert chances into goals and it is now Canada that has the shot at Olympic glory despite sending more players forward in the dying minutes.
Canada, who held Brazil to a 0-0 tie in the quarterfinals before winning in a penalty shootout, won bronze medals at the 2012 and the 2016 Olympics.
The Americans won gold medals at the 1996, 2004, 2008 and 2012 Games, as well as a silver in Australia in 2002. But the team has looked out of sorts at these Games, losing 3-0 to Sweden in its opening match.