Frenchwoman Cornet, who eight years ago produced a Wimbledon sensation when beating Serena Williams, delivered another show-stopping result when she won 6-4 6-2 against the No.1 seed.
It happened on the tournament's middle Saturday, local time, and on Court One, just as the victory over Williams in 2014 had.
Swiatek had reeled off 37 successive wins, landing six titles in the process, including a second French Open crown. However, she has appeared far from comfortable on the grass in London, and it was clear she would be ripe for such an upset if her performance level from the first two rounds did not improve.
Cornet, who at the age of 32 is competing in a record-tying 62nd consecutive grand slam tournament, will face Australia's Ajla Tomljanovic on Tuesday (AEST) for a place in the quarter-finals.
In an on-court interview, Cornet said of her win: "It reminds me of the time I beat Serena on the same court eight years ago. I think this court is a lucky charm for me.
"I want to say I'm a huge fan of Iga. She is just so talented, and she's such an amazing player and such a nice ambassador of women's tennis, so I'm very flattered that I beat her today.
"I think this kind of match is what I'm living for and practising for every day. It really drives me, and I knew I could do it. Somehow I had this belief, even through she had 37 wins in a row.
"It was like, if there is a moment you can beat her it's now, on grass. She feels a little less comfortable than on other surfaces, so I was just believing very hard, very focused, and I have the best team by my side and the best crowd also.
"So I guess I like the upsets. It's a really nice feeling right now.
"I'm like a good wine. In France, a good wine always ages well. It's unreal, I'm playing one of the best seasons of my career. I feel great on the court. I'm having so much fun. Eight years later after my first qualification into the second week I can see I'm still there, I'm still so motivated, and I still have the fire in me."
Swiatek slumped from a 2-0 lead in the second set, dropping six successive games as the match slipped away.
The beaten Pole said: "I know I didn't play good tennis. I was pretty confused about my tactics. When I was practising I didn’t feel in the best shape. So I was aware this could happen.
"Usually when I'm coming back, I have some kind of a plan and I know what to change.
"Here I didn't know what to change. I was confused. On a grass court everything happens so quickly. I didn't tank it, but I just didn't know what to do."