The hosts, who are looking to qualify for their first ever World Cup, rode a rollercoaster of emotions as they powered to a 96-90 double overtime win.
The result leaves Bosnia fourth in the six-team group, just one point away from a World Cup qualifying spot.
France, who are ranked fourth in the world by FIBA, may have arrived in Sarajevo as overwhelming favourites but they quickly understood the scale of the challenge after falling 18 points behind in the first quarter.
As one of Europe's powerhouses, the French were able to mount a 30-point swing to take a 12-point lead half way through the third quarter.
Bosnia, who are all the way down in 46th in FIBA's world rankings, showed incredible heart as they stopped the rot and produced an incredible 20-0 run in the penultimate quarter to go back in-front.
France rallied and forced overtime with a dunk from Evan Fournier, and soon had to find another late dunk to take the match into a second additional session.
With Bosnia and Herzegovina big man Jusuf Nurkic fouled out, the rest of the team stepped up in the second overtime to get the win after 50 minutes.
Nurkic led the way in the contest though with 21 points, 9 rebounds and 4 assists while John Roberson scored 18 points and Dzanan Musa collected 17 points, 6 rebounds and 5 assists.
France were led by Fournier with 24 points, with Guerschon Yabusele picking up 16 points and Gobert adding 10 points and 14 rebounds before he was banished to the bench early.
Bosnia's Miralem Halilovic described the win as one of the greatest in Bosnia's history, telling FIBA: "I would say it's one of the best wins since I have been with the national team. And I have been with the national team for 14 or 15 years.
"It's one of the biggest victories that we have ever had. It feels great. It was in front of our fans, in front of our people. It feels good because it was against France and I have been playing in France for five years. So it feels even better."
Photo Credit: fiba.basketball