Injuries sustained to Lucas Digne and Lucas Hernandez against Portugal forced Les Bleus boss Didier Deschamps into changing his system.
France lined up in a three-man defense, with Clement Lenglet making his first appearance of the tournament.
Switzerland went ahead in the 15th minute when the impressive Steven Zuber sent a delightful cross into the box for Hafis Seferovic to glance home.
France struggled to get going in the first half, with Yann Sommer rarely threatened in the Swiss goal.
Deschamps took off the ineffective Lenglet at halftime and reverted to a more traditional back four but the second half started in the worst possible way for the world champions.
Steven Zuber had been running rings around the French defenders throughout the first half and his trickery proved too much for Benjamin Pavard who felled him in the area seven minutes after the restart. .
The referee initially waved play on but reversed his decision after consulting with the pitchside monitor.
Ricardo Rodriguez stepped up to take responsibility despite his shaky record from the spot and Hugo Lloris pulled off an excellent save to deny the Torino defender.
Chances like that against quality teams in the mold of France come at a premium and Switzerland were made to pay for their profligacy in the space of two minutes.
First, Karim Benzema drew France level when he headed home from close range after Antoine Griezmann‘s shot had been parried into his path by Sommer. Two minutes later, the Real Madrid striker put his side ahead after showing great technique to round a defender and slot home just before the hour mark.
This sparked France into life as they dominated proceedings and Paul Pogba scored the goal of the night when he blasted a rocket into the top corner from 25 yards in the 75th minute.
The goal was of such immense quality that it gave Sommer no chance in the Swiss goal.
A two-goal lead with just 15 minutes to go had seemingly put Les Bleus through to the next round but as the Croatia and Spain game showed us earlier in the day, anything can happen in football.
Seferovic gave Switzerland hope when he halved the deficit in the 81st minute after substitute Kevin Mbabu had put the ball on a plate for him in the air.
With nine minutes to go, the Swiss smelled blood and had the ball in the back of the net soon after only for Mario Gavranovic to be pulled up for the most marginal offside decision.
The Dinamo Zagreb man was, however, not to be denied and he forced extra-time with a brilliantly taken goal in the 90th minute after he was played through by Granit Xhaka.
There was still time for Kingsley Coman to strike the post with the last kick of regular time to ensure that the six-goal thriller had everything from missed penalties to spectacular goals.
Extra-time was a less intense affair, understandable given the immense levels of energy both teams had exerted, although France still managed to carve out some decent chances.
The two sides could not be separated after two hours of breathtaking football. This ensured that we witnessed the first penalty shootout of Euro 2020.
The first nine takers were perfect but it was Kylian Mbappe who had the decisive miss to send France packing and Switzerland through to the last eight to take on Spain on Friday.
This is the first time that Switzerland will reach the quarterfinal of a major tournament in 57 years and they will be taking on a Spanish side that were also pushed to the limit earlier in the day.
Here are five talking points from the dramatic game in Bucharest.
#5 France bow out of Euro 2020 without a whimper
France came into Euro 2020 as joint-favorites to win the tournament alongside Belgium.
The world champions are well-stocked in every department and would have been looking to go one better than their second-place finish on home soil five years ago.
Despite being drawn into the group of death, France were still tipped to come good and that proved to be the case as they topped a group that also contained Germany and Portugal.
However, the French side were far from convincing in any of their three group stage games. They needed an own goal to see off Germany, flattered to deceive against Hungary and were arguably lucky to have nicked a draw against Portugal.
The game against Switzerland offered France an opportunity to hit second gear but a poor start to the game had the world champions rocking.
There was a brief thirty-minute period between their three goals when France looked assured in their play. The front three of Antoine Griezmann, Kylian Mbappe and Karim Benzema worked in tandem, while Paul Pogba effortlessly played defence-splitting passes behind them.
However, that was as good as it got in the tournament for the two-time European champions.
Just one good half in four matches is nowhere near good enough for a side boasting as much world-class talent as France and this is far from the levels expected.
The tournament favorites have been eliminated from Euro 2020 knowing that they did not bring their A-game.
#4 Dogged Switerland defy expectations to produce upset of the tournament
Switzerland have some quality players in their current ranks and were ranked by many to be among the dark horses of the tournament.
However, the Alpine side are far removed from being considered an elite side. While they have just a handful of players playing at the highest levels, the French squad is replete with world-class players from front to back.
Given how dramatic Euro 2020 has been to date, it can be argued that no genuine upset was produced in the group stage.
Hungary being minutes away from eliminating Germany threatened to create unbelievable headlines but the four-time world champion ultimately came through.
The Czech Republic eliminating Netherlands on Sunday might have been a little unexpected but it does not match the giant-killing that Switzerland produced in Romania against France.
The manner in which Vladimir Petkovic’s side attained the shock result was even more thrilling. Having started the game brightly, Switzerland were handed a golden opportunity to go two goals up but failed to take it.
France subsequently turned the game on its head and were so dominant in the next 15 minutes that the Swiss struggled to get out of their blocks.
Their tournament was seemingly over with just 10 minutes to go but a resilient display from the Swiss ensured they clawed back to snatch victory from the jaws of defeat.
So far, this ranks as the upset of the tournament and kudos to Switzerland for holding their heads up when it would have been easy to lose composure against a superior side.