The 39-year-old had rounded into form through the first week to raise hopes of an improbable trophy run after two knee operations and a month short of his 40th birthday.
But Hurkacz is a top-20 player and 15 years Federer’s junior, and was simply too good on the day for his opponent, who suffered a straight-sets loss at Wimbledon for the first time in 19 years.
After a poor first set in breezy conditions, Federer led 4-1 in the second but he could not find his timing and Hurkacz kept his wonderfully to win 6-3 7-6 (4) 6-0, handing the Swiss his first ever bagel at Wimbledon.
A solemn but composed Federer said afterwards about his hopes of returning: “I really don’t know. I’ve got to regroup. My goal was always for the last year and more to try to play another Wimbledon.
“I was able to make it this year, which I’m really happy about. Obviously we’re going to speak a little bit tonight, depending on how I feel, then the next couple of days as well. Then we go from there. Just see, OK, what do I need to do to get in better shape so I can be more competitive.
“I’m actually very happy I made it as far as I did here and I actually was able to play Wimbledon at the level that I did after everything I went through.
“Of course I would like to play it again, but at my age you’re just never sure what’s around the corner.”
The first decision to be made will be whether Federer competes at the Tokyo Olympics while, on the prospect of imminent retirement, he said: “It’s just about having perspective.
“You need a goal when you’re going through rehab. You can’t think of the entire mountain to climb at once. You’ve got to go in steps. Wimbledon was the initial first super step.
“I knew it was going to be really hard, to be honest. Now I’ve just got to talk to the team, take my time, not feel rushed by you guys or anybody else. Take the right decision, the one decision I want to take and where I feel most comfortable.
“That’s where it leaves me. But, no, I hope not that that (retirement) is going to happen. The goal is to play, of course.”
Hurkacz, who has been compared to Andy Murray, was playing in his first grand slam quarter-final and talked glowingly after his fourth-round victory about his opponent, but he did a superb job of not playing the occasion.
He had only won four tour-level matches on grass prior to this tournament but recovered from two sets to one down against second seed Daniil Medvedev on Tuesday, finishing the match under the roof on Centre Court.
He settled quickly into the contest while Federer, despite leading 4-1 in the second set, never looked comfortable and struggled to find the middle of the strings.
The tie-break was huge for both men, and a very untimely slip on an easy volley left Federer 4-2 down and proved very costly.
The eight-time champion had not come from two sets down to win a match for five years, and the crowd willed their hero on, but Hurkacz was simply far too good for this Federer.
Federer kept his perspective, saying: “It was tough. The last few games obviously as you can feel that you’re not coming back from it.
“I’m not used to that kind of situation very much, especially not here. Hubert played great. It was a tough end.
“Clearly there’s still a lot of things missing in my game that maybe 10, 15, 20 years ago were very simple and very normal for me to do. Nowadays they don’t happen naturally anymore.
“I felt very disappointed in the moment itself. I still am. At the same time there’s always a weight that falls off your shoulders when a tournament is over, when a huge goal is made or missed. I feel horribly exhausted. I could go for a nap right now.
“I know I will be upbeat again shortly. I know how I am in these situations.
“I feel like I go maybe very hard on myself, I get very sad, and then a few hours go by - maybe even a few days, I don’t think so – then I’ll be totally fine again and be my old self.”
Hurkacz, who will take on Queen’s champion Matteo Berrettini in the last four, is the second Polish man to reach the semi-finals at a grand slam after Jerzy Janowicz here eight years ago.
He said: “Obviously walking off the court, realising that I won against Roger, just kind of a dream come true, especially here on grass in Wimbledon. Felt so special with the crowd around as well.”
Novak Djokovic eased into the semi-finals with a 6-3 6-4 6-4 victory over Marton Fucsovics and is now just two wins from claiming a 20th grand slam title.
Djokovic will face 10th seed Denis Shapovalov of Canada after he won a five-set marathon against Russia’s Karen Khachanov.
Seventh seed Berrettini got through 6-3 5-7 7-5 6-3 against Canada’s Felix Auger-Aliassime.