Top seed Williams, a five-time Wimbledon champion, had reached at least the last 16 in each of her previous seven visits to the All England Club, but Cornet fought back from a set down to end that sequence in two hours and four minutes of gripping drama on Court One.
It was the shell-shocked 32-year-old's earliest Wimbledon exit since her loss to Jill Craybas at the same stage in 2005.
Serena could have no complaints about an embarrassing defeat which continued a disappointing campaign for the 17-time Grand Slam champion, who has failed to get beyond the fourth round at any of the three majors so far this year.
After a sluggish start, Cornet produced some simply brilliant play in the final two sets and the reward for the best result of her career is a fourth round clash against Canadian 13th seed Eugenie Bouchard on Monday.
It will be the 24-year-old's first appearance in the second week of Wimbledon at the eighth attempt and only her second career fourth round appearance at a Grand Slam.
Cornet, who celebrated one of the great Wimbledon upsets by kissing the turf in jubilation, said: "I just can't believe it. A few years ago I couldn’t even play on grass. I was so bad.
"To beat Serena at Wimbledon, wow, it is just a dream. It is the biggest upset in the tournament because she is the world number one and has won here so many times.
"I thought it was going to be tough when I lost the first set but finally I did it.
"I can't believe that I did it myself. It is a great moment. I've been working so hard and this is the reward."
Serena had arrived in south-west London desperate to make amends for her shock first round exit against Garbine Muguruza at the French Open last month, a chastening result which followed her Australian Open fourth round defeat against Ana Ivanovic.
But instead she departs seething after another lacklustre display that leaves her position as the sport's dominant force suddenly looking uncertain.
She failed to heed the warning signs from her defeat against Cornet in the Dubai semi-finals earlier this year and there was an early hint of the drama to come as the Frenchwoman broke Williams in the opening game.
Serena broke back before rain brought a halt to proceedings at deuce in the third game and when the weather finally improved four and a half hours later she looked set to cruise through.
Williams broke for a 3-1 lead and then secured the decisive second break that clinched the first set.
That should have been the signal for Williams to close out the victory, but she suddenly went flat, losing her rhythm, and Cornet broke twice to race into a 5-0 lead.
Serena was being so out-played that it was almost a surprise when she held to serve to avoid the humiliation of failing to win a single game in a set at a Grand Slam for the first time since 1999.
But Cornet continued to torment Williams with some brilliant groundstrokes and the American had to stave off four break points at the start of the final set, prompting a defiant roar and clenched fist in the direction of her opponent.
Even that couldn't rattle Cornet and she broke in the fifth game before delivering the knockout blow with another break for a 5-2 lead.
Serena staged a brief revival to make Cornet serve out the match, but it was too late to ruffle the ice-cool Frenchwoman, who held to love before collapsing to the floor in exhaustion and joy.