Kevin Anderson, left, rallied from two sets down to deny Roger Federer’s bid to win his ninth Wimbledon title this year. (Ben Curtis/Associated Press)

Regardless of rooting interest when Wimbledon got underway July 2, there was one matchup that virtually all tennis fans wanted to see in the men’s final: Roger Federer vs. Rafael Nadal, 10 years after they played what many believe is the greatest match in the sport’s history on Centre Court.

Nadal prevailed in the fifth set as night fell that July 2008 evening, and he collapsed on his back after toppling the Swiss champion.

A decade later, a reprise seemed destined.

Now 36 and 32, Federer and Nadal had defied time, injury and a succession of rivals to reassert their dominance — splitting the titles of the past six majors and returning to the All England Club for Wimbledon’s 2018 edition as the tournament’s Nos. 1 and 2 seeds, respectively, and the world’s top-ranked players.

But the longed-for Wimbledon sequel was scuttled at the quarterfinal stage Wednesday, with Federer, bidding to extend his men’s record eight Wimbledon championships, squandering a two-sets-to-none lead and a match point in falling to hard-serving, free-swinging Kevin Anderson, a 6-foot-8 South African who played the match of his life in claiming a 2-6, 6-7 (7-5), 7-5, 6-4, 13-11 victory.

In a 4-hour 48-minute match of even higher quality, world No. 1 Nadal weathered 33 aces and a barrage of groundstrokes from Juan Martin del Potro to book his place in Friday’s semifinals, 7-5, 6-7 (9-7), 4-6, 6-4, 6-4.

Both Nadal and del Potro displayed breathtaking athleticism and shotmaking throughout yet raised their intensity higher still in the fifth set. In one sequence, the 6-6 del Potro dived full out to intercept a sharply angled passing shot and stabbed it back for a winner a split-second before falling to the ground with a thud. A few moments later, Nadal leaped over a knee-high courtside barrier and into the front row of spectators’ seats in pursuit of a ball, then apologized to the startled ticket holders before trudging back to the soul-sapping task of fending off del Potro’s thunderstruck forehands.

On the sheet of match statistics that was crammed with 144 winners and 36 aces, there was no category for the number of times del Potro and Nadal ended up on the ground, whether lunging for balls or losing their footing in pursuit.

And that is how the match ended, with del Potro slipping while quickly changing direction after Nadal had yanked him wide on the Argentine’s backhand side with a serve on set point. Del Potro fell facedown and lay on the grass motionless for what seemed like minutes — long enough for the chair umpire to announce, “Game, set and match, Nadal,” and for the Spaniard to step over the net. He met del Potro as he rose from the ground, utterly gutted, and they shared an embrace.

“I didn’t want to finish the match like that [slipping on the final point],” del Potro explained later. “I wanted to stay [on the ground] there for all night long. But Rafa came to me, and we made a big hug. It was kind.”

While he didn’t hide his sadness over the loss, del Potro also made clear he couldn’t have risked more or tried harder.

“Against Rafa, you must go for winners all the time,” del Potro said. “I think I played really good tennis today. But Rafa is Rafa. Sometimes you play your best tennis and it’s not enough against him.”

With the victory, Nadal earned a spot in Friday’s semifinal against three-time Wimbledon champion Novak Djokovic, who overcame Kei Nishikori and his own bad behavior (twice smacked with code violations for racket abuse and a time violation) to earn a 6-3, 3-6, 6-2, 6-2 victory.

Anderson will take on American John Isner, who subdued Canada’s big-serving Milos Raonic (31 aces) to reach the semifinals of a major for the first time. After winning the second-set tiebreaker, the 6-10 Isner cruised to a 6-7 (7-5), 7-6 (9-7), 6-4, 6-3 victory. Isner and Anderson, now good friends, have an unusual history for top-10 players, having been rivals in the college ranks when Isner played for Georgia and Anderson for Illinois.

Federer was greeted warmly Wednesday by Court One ticket holders who never imagined they would have a chance to see him in person. The Swiss champion hadn’t been assigned any court except Centre Court since 2015.

But Wimbledon’s most decorated male champion seemed immediately at home in the unfamiliar environs, claiming the opening set in just 26 minutes on the impeccable form he had shown in winning his five previous matches without losing a set or his serve.

But after failing to convert a match point in the third set, Federer allowed a rash of errors to creep into his game, particularly on the forehand side.

Emboldened, Anderson, who hadn’t beaten Federer in four previous meetings, went on an all-out attack. He fought back from match point and love-40 on his serve to take the third set.

Then he broke Federer midway through the fourth set and kept his composure while Federer netted backhands and overhit forehands — committing the everyday errors of journeymen.

Further aggravating Federer was the fact that he couldn’t figure out where Anderson was going with his big serve. “I had moments where I was great; I felt like I was reading his serve,” Federer said. “Other moments where I don’t know where the hell I was moving to.”

Anderson held his nerve as the prospect of the greatest victory of his career inched closer in the fifth set. There was no drop-off in intensity, no letdown in the quality of his play.

Serving at 5-6, Anderson fell behind love-30, which put Federer two points from victory. Still, he couldn’t capitalize.

With fifth-set tiebreakers not permitted at Wimbledon, they played on — each point heavy with implications.

Federer served first in the seesaw battle of extra time, which ought to have put Anderson at a slight psychological disadvantage, forced to serve from behind just to stay even. There was no sign it bothered him, though, as the match surpassed the four-hour mark. Anderson replied each game, leveling at 7-7, 8-8, 9-9, 10-10.

Serving at 11-11, Federer appeared distracted by a shout from the stands during a point, then by a plane flying overhead. Anderson got the crucial break, then served out the victory.

“I feel like my commitment to the kind of tennis I wanted to play throughout the match — it got definitely better as the match progressed,” said Anderson, 32, who hadn’t been past the fourth round of Wimbledon in nine previous appearances. “I was really proud of myself for the way I was able to relax, play my game.”