The U.S. entered the tournament as the reigning two-time champion but was bounced at its earliest stage ever, exiting by the narrowest of margins, with Lina Hurtig's winning penalty barely crossing the line and requiring VAR to confirm the goal.
Vlatko Andonovski's side made its way out of the group stage despite winning just one game, and the Americans struggled again as Sweden goalkeeper Zećira Mušović nullified their dominance with a number of inspired saves to send the game to extra time tied 0-0.
Megan Rapinoe -- who entering this tournament announced that this would be the final World Cup of her career -- came off the bench on 99 minutes in place of Alex Morgan, and the U.S. added even more pressure on Sweden's goal but could not break the deadlock, and the game went to penalties.
The USWNT netted its first three spot kicks, but saw attempts from Rapinoe, Sophia Smith and Kelley O'Hara miss the target before Hurtig stepped up with a chance to win the match. USWNT goalkeeper Alyssa Naeher got a hand to Hurtig's attempt and nearly kept it out, but the ball looped toward the goalline, and after Naeher knocked it away a second time, a VAR check showed it had crossed the line by a tiny margin.
"I am proud of the women on the field," Andonovski said. "I know we were criticized for the way we played, and for different moments in the group stage. I think we came out today and showed the grit, the resilience, the fight. The bravery showed we did everything we could to win the game. And unfortunately, soccer can be cruel sometimes."
The USWNT's only other penalty shootout defeat at the Women's World Cup came in the 2011 final against Japan.
It has a record four World Cup titles overall and was trying to win an unprecedented third consecutive title. The Americans' previous worst finish had been third place, on three occasions.
The USWNT also ends the tournament on a 238-minute scoring drought, its longest in Women's World Cup history.
Defender Julie Ertz, who was playing in her third World Cup, was in tears after the match.
"We didn't put anything in the back of the net," Ertz said. "The penalties was tough as well. It's just emotional because it's probably my last game ever. It's just tough. It's an emotional time. It obviously sucks. Penalties are the worst."
Information from the Associated Press contributed to this report.
- Stephanie Frappart