LONDON: Roger Federer was a point away from a rather tidy, straight-set victory in the Wimbledon quarterfinals. One lousy point.

And then, slowly, over the next two-plus hours, all the way until the fifth set reached its 24th game, as the temperature dropped and the spectators’ cries of “Let’s go, Roger!” echoed through the shadows, everything came apart for the eight-time champion. Against an opponent who’d never beaten him nor made it this far at the All England Club.

In a stunning turnaround in an unfamiliar setting — No. 1 Court instead of Centre Court — the top-seeded Federer blew a third-set match point and, eventually, all of his big lead in a 2-6, 6-7 (5), 7-5, 6-4, 13-11 loss to No. 8 Kevin Anderson on Wednesday in a four-hour, 14-minute tussle.

“It was just one of those days where you hope to get by somehow,” said Federer, who last played at No. 1 Court in 2015. “I almost could have. I should have.”

While his tournament is over, two of his longtime rivals at the top of tennis set up a semifinal showdown: Rafael Nadal and Novak Djokovic. Nadal, who’s won two of his 17 Grand Slam titles at Wimbledon, edged 2009 U.S. Open champion Juan Martin del Potro 7-5, 6-7 (7), 4-6, 6-4, 6-4 in a wildly entertaining match that featured diving shots by both and lasted 4 hours, 48 minutes.

Djokovic, whose 12 major championships include three from the All England Club, got to his first Grand Slam semi­final since 2016 by beating No. 24 seed Kei Nishikori 6-3, 3-6, 6-2, 6-2.

In Friday’s other men’s match, Anderson will face No. 9 John Isner, the 33-year-old American who reached his first major semifinal in his 41st try by eliminating 2016 runner-up Milos Raonic 6-7 (5), 7-6 (7), 6-4, 6-3. Isner hit 25 aces, saved the only break point he faced, and has won all 95 of his service games in the tournament.

Federer hadn’t been broken until facing Anderson. Still, the 20-time major champion was leading by two sets and 5-4 in the third when, with Anderson serving, he got to Ad-Out. He could have ended things right then and there. Federer managed to return a 134 mph serve, but on his next stroke, he shanked a backhand.

Back to deuce. From there, it all began to change. Anderson held for 5-all, broke to 6-5 with a violent return winner off a 97 mph second serve, then staved off three break points and closed the set with a 133 mph ace.

The comeback was just beginning.

“I had my chances,” Federer said, “so it’s disappointing.”

This was only the third time in Federer’s 20 years of contesting Grand Slam matches that he lost after taking the opening two sets; both of the other defeats came in 2011. And, according to the ATP, it’s the fifth time Federer lost a match at a major after holding a match point, something else that last happened seven years ago.

How hard was it to see this coming?

First of all, Federer was 4-0 against Anderson, winning every set. But there was more. So much more. Federer was attempting to reach his 13th semifinal at Wimbledon and move closer to title No. 9, both of which would have broken his own records.

He came into the match having won 32 consecutive sets at Wimbledon, a run he stretched to 34 before faltering.

“I just kept on telling myself, ‘I have to keep believing.’ I kept saying that today was going to be my day,” Anderson said, “because you really need that mindset taking the court against somebody like Roger.”

Anderson was the runner-up to Nadal at last year’s U.S. Open, but he never made it beyond the fourth round at Wimbledon until this week. He hit 28 aces against Federer, saved nine of 12 break points and managed to hold his own in the rare lengthy baseline rallies.

“It’s like that with the big servers,” Federer said. “You’re never really safe.”

As the fifth set became as much a test of mental strength as anything, from 4-all to 6-all to 8-all to 10-all, Anderson stayed steady. It was Federer who blinked, double-faulting to face a break point at 11-all, then slapping a forehand into the net.

Anderson, a 32-year-old South African who played college tennis at Illinois, served it out, ending things with a 128 mph service winner before raising both arms.

Djokovic got his wish to play in the main stadium, and he showed that he might completely be back from right elbow troubles that lasted more than a year until he finally had surgery in February.

He’s been flashing some anger this fortnight and did so again in the second set, bouncing his racket off the turf after failing to capitalize on three break points at 1-all. That earned a code violation from chair umpire Carlos Ramos. When Nishikori let his own racket fly in the fourth set, he wasn’t chastised, which prompted Djokovic to yell “double standards” toward Ramos — drawing boos from fans.

Djokovic is on his way to the semifinals, where he will meet Nadal.

“I like the level of tennis that I’m playing on right now. I really do. I think with the performances I’ve had, I deserve to be in the semifinals,” Djokovic said.