As much as Roger Federer squandered a prime opportunity in Tuesday’s quarterfinal, Grigor Dimitrov redeemed himself in a shocker.

The tennis gods work in mysterious ways, but they’re going to have a hard time explaining this one. We know they have an aversion to Roger Federer and Rafael Nadal playing at the U.S. Open—that much, after a decade and a half of their rivalry, seems clear enough. But deploying Grigor Dimitrov—loser of seven of eight matches entering the U.S. Open, a man whose ranking has dropped to No. 78 from a career-best No. 3 in November 2017 and had never beaten Federer—to work their divine intervention? Sure, after Novak Djokovic lost in the fourth round, it was obvious they’d have to get creative to prevent New York from at last getting its long-overdue Federer–Nadal showdown. But for Dimitrov as the spoiler? That’s taking mysterious to a new level.

Dimitrov, playing his first U.S. Open quarterfinal, likewise took his game to a new level. Before Tuesday night, he was 0-7 against Federer, having won only two sets over those seven matches. But in front of a partisan pro-Federer crowd at Arthur Ashe Stadium, Dimitrov twice rallied twice from a set down, advancing to his third Grand Slam semifinal with a 3-6, 6-4, 3-6, 6-4, 6-2 victory, perhaps the biggest of his career.

Federer, pegged a co-favorite to win the tournament after Djokovic’s exit, started well enough, winning the first set comfortably. But as the 20-time Grand Slam champion played flat and started to struggle physically, Dimitrov found his game in the second set. With Federer serving at 2–3, Dimitrov earned his first break of the match, taking advantage of consecutive unforced errors from Federer—a forehand shank that sailed long and a routine forehand into the net—to grab control of the second set. Dimitrov dropped his serve at 5–3, but immediately broke back to even the match at one set apiece.

Federer regained momentum in the third set, winning 30 of 51 points and breaking Dimitrov twice. But Dimitrov wouldn’t fold, breaking Federer in the opening game of the fourth set and taking advantage of Federer’s mistakes—he racked up 19 unforced errors in the fourth set alone—to reclaim momentum. Meanwhile, as Federer grew increasingly sluggish, Dimitrov was moving exceptionally well and pushing his opponent on every point.

With Dimitrov serving for the set at 5-4, Federer forced triple break point, only for Dimitrov to save all three and then two more later that game. Dimitrov forced a decider when a 12-shot rally ended with Federer sailing a forehand long.

Federer was moving poorly and appeared to be struggling physically, and he took a medical timeout to see a trainer after the fourth set.

“I just needed some treatment on my upper back, neck—just needed to try to loosen it up, crack it and see if it was going to be better,” Federer said.

It didn’t help. Dimitrov again broke him to start the set, and then broke him once more on Federer’s next service game. He won just one of 16 points on Dimitrov’s serve in the decider.

“One of the only things for me was to try to keep him as much as possible on the court. I did that very well—a lot of long games,” Dimitrov said. “Clearly in the end he was not at his best.”

Serving for the match at 5-2, Dimitrov sealed victory when Federer hit a routine forehand wide—his 60th unforced error of the night.

After the match, Federer said he had tweaked his back earlier on Tuesday, though he was reluctant to talk much about it. “This is Grigor’s moment,” he said, “and not my body’s moment.”

True, but the defeat will sting nonetheless. Less than two months ago, Federer failed to convert two match points against Djokovic in the final at Wimbledon. He wasn’t quite that close this time, but there’s no denying that the 38-year-old missed an incredible opportunity. With Nadal looming on the other side of the draw, winning the final was no sure thing. But after Djokovic’s earlier defeat, getting to the final Sunday, with only Dimitrov and an injured Daniil Medvedev standing in his way, seemed like it would be the easy part.

“I did feel like I was actually playing really well after a couple of rocky starts,” Federer said of his tournament. “It’s just a missed opportunity to some extent that you’re in the lead, you can get through, you have two days off after. It was looking good.”

It’s another opportunity squandered, not to mention the cruel denial of New York’s first Fedal. But we must pause to acknowledge the redemption of Grigor Dimitrov, who will face Medvedev in Friday’s semifinal. In late 2017, the Bulgarian appeared a worthy challenger to the Big 3 of men’s tennis, having reached the Australian Open semifinals earlier that year, winning his first Masters 1000 trophy in Cincinnati and finishing the season by winning the ATP World Tour Finals. At the start of 2018, he was world No. 3, but his momentum quickly evaporated. After winning four titles in ’17, he failed to win a single trophy in ’18 and has yet to win a tournament this year. In five of his last six tournaments before the U.S. Open, he lost in the first round, including a straight-sets defeat in Atlanta to Kevin King, a journeyman currently ranked outside the top 400.

“I think the past six, seven months have been pretty rough for me,” Dimitrov said after the match. “But I had somebody to lean on—my friends, my family. I kept on believing in the work.”

Early in his career, Dimitrov was dubbed “Baby Fed,” a nod to the resemblance of his playing style to Federer’s. The nickname, of course, is an impossible burden: To be compared favorably to Federer, with virtually none of the accompanying success, can only be oppressive. So it’s no wonder that Dimitrov snapped this spring when a fan at Roland Garros urged him on using that nickname. “Do I look like a baby to you?” Dimitrov retorted.

How fast they grow up.