Murray was prompted to make the emotional announcement following a humbling practice match defeat to Djokovic ahead of the Australian Open.
The Scot has failed to get back to his former greatness following a chronic hip injury, and felt the time was right to call it a day.
Djokovic and Federer were both shocked by the sudden announcement from one of their contemporaries in the game.
"It’s quite a shock for me honestly because we are the same age, the same generation," Djokovic told reporters in Melbourne.
"It’s quite sad to see him going through what he has been going through. As someone who has been through a major injury with my elbow in the last couple of years, I can definitely empathise with him and relate to what he’s going through.
"I trained with him a couple of days ago and we got to chatting a little bit. He’s a great champion, he’s a friend of mine that I grew up with.
"It’s kind of sad to know that he might play his last Australian Open but I do wish him all the best. There’s a lot of things in life I’m sure to be grateful for."
Meanwhile in an interview with the Sunday Age, Federer admitted he was also shaken by the news.
"It hit me hard," he said. "Of course, I’ve seen Andy struggling you know with his hip and with his fitness for quite some time now.
"You want somebody to go there and feel like he’s happy to retire. The problem is it’s not his decision, it’s the body’s decision and that naturally hurts."
Many have remarked that Murray was unlucky to come up during a time when guys like Federer, Nadal and Djokovic were dominating the scene, but Federer doesn't agree with that viewpoint.
"I mean, he won Wimbledon, he won the Olympics, became world No 1. Is that unlucky? I don’t know," he said. "I always said you can have great careers, you can have great careers side by side. Maybe from Aussie stand point, yes he’s been unlucky because he made five finals here (in Melbourne) and never won one. But that’s why I think he will also be even more loved you know because he maybe didn’t make it here."
Federer said Murray can be proud of what he achieved in tennis, and always giving it his all.
"I feel like he left everything out there. There was never any doubts there. And I think he should be very proud even though he was extremely sad in the press conference and you know, you don’t want to see that."