A Kylian Mbappe penalty shootout miss saw Switzerland win a knockout tie at a major tournament for the first time since 1954, sending world champions France packing at the round of 16 stage.
Didier Deschamps' team were abject in the first half, failing to adjust to a back three system and leaving plenty of space in behind for the Swiss to attack. Haris Seferovic struck first, overpowering Clement Lenglet and sending a wonderful header beyond Hugo Lloris.
Deschamps changed the shape to something more familiar at half-time, but it didn't work immediately. Benjamin Pavard's rash challenge gave Ricardo Rodriguez the chance to send France packing, but Hugo Lloris met it and the French had a lifeline.
They used it well too. All of a sudden, the world champions sprung into life, with Kylian Mbappe, Karim Benzema and Antoine Griezmann putting the Swiss to the sword. The three combined wonderfully, and a four-minute double-salvo from Benzema turned the game on its head.
Paul Pogba then got in on the act with a glorious strike from distance, and it seemed as if it would all be plain-sailing from there. But you just can't take anything for granted at Euro 2020, can you?
Seferovic came to the fore again with another header that threw the Swiss a life raft of their own, and with one wonderful strike from substitute Mario Gavranovic, they jumped right on it and sent a pulsating game into extra-time.
A couple of great stops from either keeper meant penalties awaited, and after nine successive spot-kicks were converted, it was Mbappe of all people who saw his kick saved by Yann Sommer as Switzerland came up with one of the shocks of the tournament.
Here's how the players rated.
France player ratings
1. Goalkeeper & Defenders
Hugo Lloris (GK) - 7/10 - Guessed correctly to save the penalty in normal time and keep France alive. Not much chance with any of the three Swiss goals.
Raphael Varane (CB) - 6/10 - Started shakily and that set the tone for another unconvincing France performance. Appeared to be going tonto at his teammates after Gavranovic's strike crossed the line.
Clement Lenglet (CB) - 4/10 - Completely overpowered by Seferovic for the opener and hooked at half-time for his troubles.
Presnel Kimpembe (CB) - 6/10 - Didn't really get a chance to settle into the game, playing in three different positions at one point or another.
2. Midfielders & Wing-backs
Benjamin Pavard (RWB) - 6/10 - Seemed much more comfortable after a switch to a back four in the second half but an incredibly clumsy foul to give away the penalty.
Paul Pogba (CM) - 8/10 - Curled one right into the top corner from about 25 yards to kill the game dead...or so it seemed at the time. Cost his team with some weak possession play in the build-up to the Swiss equaliser, but grew into the game the longer it went on and turned in a passing masterclass in extra-time.
N'Golo Kante (CM) - 6/10 - Covered every blade of grass but that's just what you expect from him now, isn't it? Otherwise one of his quieter games.
Adrien Rabiot (LWB) - 5/10 - Still not sure what Rabiot is, but he definitely is not a left-back. Ran a lot down the left without doing much else, though did go close with a long-range raker in the first half.
Karim Benzema (CF) - 8/10 - Took up a strange wide position in the first half but wrought havoc when he was moved into his more familiar central role. His first goal was magical.
Kylian Mbappe (CF) - 7/10 - Seemed off the pace for the most part but exploded into life after Lloris' penalty save. Nice assist for Benzema to get France back into the game and then a glorious back-heel to start the move for the second.
Antoine Griezmann (CF) - 6/10 - Lovely little chipped assist got France's noses in front. Deschamps will have regretted subbing him off as Switzerland's equaliser sailed in a minute later.
Kingsley Coman (Lenglet, 46) - 6/10
Moussa Sissoko (Griezmann, 88) - 5/10
Olivier Giroud (Benzema, 94) - 6/10
Marcus Thuram (Coman, 111) - 4/10
Switzerland player ratings
5. Goalkeeper & Defenders
Yann Sommer (GK) - 8/10 - Deceptively quiet first 90 minutes but came up with a number of key stops in extra-time, then made himself a hero in the shootout.
Nico Elvedi (CB) - 6/10 - Stepped out of defence to win the ball back a few times. His positioning left a bit to be desired but he made up for it with his pace on the cover.
Manuel Akanji (CB) - 7/10 - The glue that held things together in the middle of the three. Really impressive aside from four minutes where France blew the Swiss away.
Ricardo Rodriguez (CB) - 6/10 - Stood up well to Mbappe and kept things tight on the left of the Swiss back three. Really poor penalty however.
6. Midfielders & Wing-backs
Silvan Widmer (RWB) - 5/10 - Struggled defensively as the game wore on, particularly after Coman's introduction at half-time. Withdrawn before the comeback started.
Remo Freuler (CM) - 7/10 - Shielded the back four well and competed valiantly against an unsettled French midfield.
Xherdan Shaqiri (AM) - 5/10 - Couldn't really make his mark on the game as Switzerland scored early and then sat deep.
Granit Xhaka (CM) - 8/10 - Utterly impeccable for the most part, slamming the door in the face of the esteemed France midfield pairing.
Steven Zuber (LWB) - 7/10 - Lovely clipped cross for the opener and made his presence felt before being subbed off towards the end.
Haris Seferovic (CF) - 8/10 - Quality header to get things started, steering it past Hugo Lloris from a fair distance. His second wasn't bad either.
Breel Embolo (CF) - 6/10 - Caused some real problems with his driving runs in behind and made a proper nuisance of himself. Subbed off before the real party started.
Kevin Mbabu (Widmer, 73) - 6/10
Mario Gavranovic (Xhaqiri, 73) - 7/10
Christian Fassnacht (Zuber, 80) - 6/10
Ruben Vargas (Embolo, 80) - 5/10
Admar Mehmedi (Rodriguez, 87) - 6/10
Fabian Schar (Severovic, 96) - 5/10