Great Britain face Serbia in a quarter-final tie on Thursday and already had injury issues to contend with, after Dan Evans picked up a calf injury that ruled him out.
It has now been confirmed that Murray will also be unavailable, meaning Britain are set to be represented in the singles by Cameron Norrie and Jack Draper, with Joe Salisbury and Neal Skupski the doubles pairing. Liam Broady has since been called up as Murray's replacement.
"I've picked up a minor shoulder injury which means I won't be able to take part in the Davis Cup," Murray said in a statement.
"I'm gutted not to be part of the squad but my focus is now on rehab and getting ready for the new season."
Before he suffered the injury, there had been a realistic possibility of Murray facing Novak Djokovic for the first time since 2017, with the three-time Grand Slam champion in contention to make the team despite his recent poor form.
Murray has won only one of his past six matches, but Norrie has been a long way from his best too and has also been battling a knee injury.
Djokovic, like Murray, has won the Davis Cup before, and has made it clear that he is fully committed to leading Serbia's bid for glory in Malaga next week.
"I really would like to win the Davis Cup with Serbia," he said.
"That’s a goal. Next week is an important week for us, for our nation. We’ll do our best.”
Murray, meanwhile, will have his focus on returning to full fitness by the time he heads to Australia at the start of 2024 for the new season.
The 36-year-old has cut an increasingly frustrated figure amid his disappointing results, especially after a particularly painful defeat to Alex de Minaur at the Paris Masters. Murray led 5-2 in the deciding set and had a match point, but went on to lose and admitted after the match he was struggling to enjoy his time on court.
"The last five, six months haven't been that enjoyable so I need to try and find some of that enjoyment back because playing a match like that there's not much positivity there," Murray said."When I play a good point, I'm not really getting behind myself in the important moments, that will to win and fight that has always been a big part of my game. What happened today, I don't remember it happening before, that's not really me.
"I haven't felt good about my game for large parts of this year."