The historic 89-79 win for France eliminates the Americans early from the competition in China, dashing their hopes of a third straight title.
The prospect of an American exit had looked increasingly possible after the USA sent a squad of second-tier stars and the loss is likely to prompt soul-searching in USA basketball.
Gobert, the two-time NBA Defensive Player of the Year, had three blocks, including a key rejection down the stretch to help France seal the victory in the southern Chinese city of Dongguan.
The 7ft, 1in centre called the win "unbelievable".
"I've been dreaming about this for a while. I was thinking we might never get the opportunity (to beat the USA) again and I told that to the guys," Gobert said.
"It doesn't mean much if you don't win the gold, but it will go down as one of the biggest wins of my career and one of the biggest wins for French basketball for sure."
In a hint of the sniping that may result in the United States over the debacle, shooting guard Donovan Mitchell, who lead the Americans with 29 points, hit back at critics of the team.
"You guys are going to go on and say who we didn't have but why don't you all focus on who we do have?" he told reporters.
"We have 12 guys that want to compete for America, just like every other country. It sucks that some of our country people don't feel that way about us, but we don't care. We wanted to compete and we did."
France will play Argentina on Friday (September 13), who made it to the final four by defeating Serbia.
- Consolation match -
The USA loss sets up an enticing consolation match with Serbia on Thursday. Packed with NBA players, the two were tournament favourites and will be trying to salvage pride.
Wednesday's contest was marked by big lead changes, and Mitchell's jumpers and slashing moves to the basket helped the Americans cut down a 10-point French advantage in the third quarter to seize back the lead.
But Mitchell cooled in the fourth and the French came back, led by Gobert and sharp-shooting small forward Evan Fournier of the Orlando Magic, who led France in scoring with 22 points.
Fournier slashed to the hoop for a driving lay-up to give France the lead again at 78-76 with about three minutes remaining in the game.
With under a minute left and down by four, Mitchell squirted into the lane for a layup but Gobert smothered the shot by his Jazz teammate and the Americans were never able to get any closer.
The win raises the prospect of France adding a Basketball World Cup title to the football World Cup hardware they won in Russia last year.
They will first have to get past Argentina. In the other bracket, Spain will face the winner of Australia-Czech Republic, who tipped off later Wednesday.
The writing was on the wall for the United States which, lacking big names like LeBron James and Steph Curry, lost to Australia two weeks ago in an exhibition.
The loss in Melbourne was the first for the United States in 78 consecutive games in major competitions and exhibition games.
They also struggled to defeat Turkey in overtime earlier in the World Cup.