Holders the United States suffered a shock 89-79 loss to France in the quarter-finals of the ongoing Basketball World Cup in China on Wednesday.
The US had won the past two World Cups and not lost in 58 international games, a run stretching back to 2006.
France were 51-41 ahead in the third quarter before the United States moved into a 72-65 lead, but the French fought back to take the victory.
Evan Fournier scored 22 points, while Rudy Gobert finished with 21.
France will play Argentina in the semi-finals on Friday, with Spain taking on Australia in the other match.
This will be the first time the United States have failed to win a medal at the World Cup since 2002, when they finished sixth.
As well as winning the past two World Cups, they have also won the past three Olympic titles.
With the victory, Spain and France became the last teams to clinch direct qualification for the Tokyo 2020 Olympics at the FIBA Basketball World Cup, having locked in their status as the two best-ranked European teams in the tournament with victorious quarter-finals performances.
France joined their continental rivals Spain through to the semi-finals, while the trio of Czech Republic, Poland and Serbia failed to make it past the quarter-final barrier.
The two European sides joined the previously qualified Argentina, Australia, Iran, Nigeria, United States to claim the last of the seven available direct qualification tickets. The tournament hosts Japan will also have a spot in the 12-team Olympic lineup.
Argentina and the United States are guaranteed to be the best-ranked national teams from the Americas region in the World Cup, Iran are tops in Asia, while no team can finish higher than Nigeria and Australia in Africa and Oceania, respectively.
Spain will now make their sixth straight and 14th overall appearance at the Olympics. Their best performance was in Rio 2016 when they clinched the bronze medal, squeaking past Australia, 89-88 for a spot on the podium.
Meanwhile, France have nine Olympic appearances to their name to date and two silver medals (1948 and 2000) to show for it.
The remaining four spots in the men’s basketball event at the Olympics will be filled by the four winners of next year’s FIBA Olympic Qualifying Tournaments which will feature six teams each.
The 16-best ranked teams at the World Cup outside the ones who clinched direct qualification have already secured places in next summer’s Olympic Qualifying Tournaments.
Additionally, two teams from each region – Africa, Americas, Asia and Europe – will be awarded places in the Olympic Qualifying Tournament according to the FIBA World Ranking presented by NIKE.