After the showers, a thunderbolt. After the delays, delirium, as Serena Williams, the five-times Wimbledon champion, was downed 1-6, 6-3, 6-4 in a wildly thrilling match by Alizé Cornet.

Cornet, the 25th seed, had never beaten a top-20 player at a grand slam in 13 attempts. Yet somehow she found the magic and resolve to recover after Williams had swatted her aside in the first set.

Not so long ago Cornet, a 24-year-old from Nice, hated playing on grass. Now, in the epicentre of the greatest triumph of her career, she kissed it.

“I cannot believe it,” she said. “A few years ago I couldn’t play on grass but now I have beaten the world No1. It’s the biggest upset of the tournament. A dream. I cannot believe I did it myself – me! – but the tournament is not over for me.”

In the last 16 Cornet will play the exciting 20-year-old Canadian Eugenie Bouchard, who reached the French Open semi-final earlier this month. But for the next 24 hours she wants to savour her brilliant victory.

“I know the next one is going to be very tough because Eugenie is playing incredible, but right now I want to enjoy my win,” she said, revelling in the moment and the attention.

Many players are beaten against Williams before they step on court. Not Cornet. She had won their last meeting, in Dubai earlier this year, in straight sets – and she carried exactly where she had left off by breaking in the opening game.

Perhaps Williams’ forehand was a little overenthusiastic and the first serve had not quite found its range, but a statement had been sent. Cornet did not intend to go quietly.

But the break was not consolidated as, after several long rallies, Williams pulled it back to 1-1. The rain was starting to fall and attentions were wavering, Williams’s included. She double-faulted to give Cornet two breakpoints only to recover before, at 1-1, deuce, the umpire called them off.

It took four and a half hours for them to come back, but when play finally resumed just before 6pm, Williams rushed into her groove. She held her service game to go 2-1 up and then broke to 30 after Cornet double-faulted.

Cornet thumped her racquet bag in frustration but Williams’ winners kept coming. She showed she had touch as well as power in the next game, urging a drop shot to float in, before smashing another forehand winner to break for a 4-1 lead.

The points and games were going by in a flash. Winner after winner crashed by. And they were all from Williams’ racket. She finished the first set with an ace. She had won six games in a row – and the five games since the resumption in just 14 minutes.

As Williams walked to the chair an American voice shouted out: “It’s been a pleasure, Serena!” Indeed it had.

But no one could foresee what would happen next. Cornet won the first game of the second set and, having rediscovered her rhythm and confidence, then broke to go 2-0. Soon it was 3-0. Then 4-0. And then, incredibly, 5-0.

Everything Cornet hit seemed to be going in. At one point Williams hit a cutting slice at her opponent’s bootlaces, yet she picked it up for an exquisite drop shot winner. The American was close to being bageled but she held her serve and then broke back as Cornet sent a forehand long.

Suddenly the momentum was shifting again. But at 5-3 Cornet held her nerve and sealed the set by smashing a short ball away.

Grass is Williams’ domain, whereas Cornet had won just 10 of her 25 matches on the surface. You expected that at some point the world No1 would assert her dominance. But Cornet was going nowhere. In the opening game of the third set – which turned into a 15-minute epic – she attacked relentlessly and had four break-points. But Williams, despite hitting three double faults in the game, held on.

At 2-2 Cornet again had more breakpoints. Three came and went before Cornet finally got the break and after that she never looked back. She held with an ace – only her second of the match – to go 4-2 up and then broke Williams again to make it 5-2.

Yet the American wasn’t done. She broke and held her serve to make it 5-4. But while Cornet’s nerves must have been break-dancing around her body she didn’t show it. She was helped by Williams, who made a series of errors before slapping a drop shot into the net at match point.

“After the break because of the rain I was so slow,” Cornet said. “I thought this is going to be tough. But she helped me a lot with a few mistakes.

“On Saturday morning I watched our match in Dubai,” she said. “It helped me especially when I had to serve at 5-4 because I knew I had done it before. It’s amazing to beat Serena two times in a row but she is just a human, like everybody.”

It has not always seemed that way over more than a decade of brilliance at Wimbledon. But for once Williams was not able to impose her will, or pull victory out of the fire, and after two hours and four minutes of tennis, Court One stood to applaud a French woman called Alizé who truly was in wonderland.