Murray has been beset by injury problems in recent years, especially to his hip, and is now ranked 78th in the world.
Former world number one Andy Murray has been forced to pull out of his match against Novak Djokovic at the Madrid Masters because of a stomach illness.
Thursday's announcement from organisers came not long before Murray was scheduled to take the court against the top-ranked Djokovic in the third round.
It would have been the first time Murray and Djokovic played against each other since Djokovic won the Doha final in 2017.
Murray had won his first two matches in Madrid, defeating Dominic Thiem and Denis Shapovalov. The former No. 1 hadn't won consecutive matches since January and hadn't played in a clay-court tournament in nearly two years.
Ranked 78th in the world, the 34-year-old Murray has been making his way up the rankings since having hip surgery in both 2018 and 2019.
He had arrived in Madrid with a 10-8 record in eight tournaments. He lost the Sydney final to Aslan Karatsev in January.
READ MORE: Novak Djokovic to be allowed to compete at Wimbledon this summer
Djokovic advances to quarterfinals
Tour officials gave no further details on Murray’s illness.
He had said after the win over Shapovalov that he was feeling fine physically.
With Murray's withdrawal, Djokovic automatically advanced to the quarterfinals — his second of the year after losing the Serbia final last month. He had lost in his first match in Monte Carlo in his first tournament on clay this season.
Djokovic is also trying to regain his best form after not being allowed to play in the Australian Open because he was not vaccinated. This is only his fourth tournament of the season. The Serb opened in Madrid with a two-set win against Gael Monfils.
Third-seeded Rafael Nadal, in his first tournament after a six-week injury layoff, takes on David Goffin, while Spanish sensation Carlos Alcaraz, celebrating his 19th birthday, faces Cameron Norrie.
Andrey Rublev, who beat Djokovic in the Serbia final, advanced to the quarterfinals after a hard-fought 7-6 (7) 7-5, win over Daniel Evans in nearly two and a half hours. The sixth-seeded Rublev converted just three of his 12 break-point opportunities.
Defending champion Alexander Zverev meets qualifier Lorenzo Musetti. Fourth-seeded Stefanos Tsitsipas faces Gregor Dimitrov.
In the women's semifinals, eighth-seeded Ons Jabeur faces qualifier Ekaterina Alexandrova, while 12th-seeded American Jessica Pegula meets Jil Teichmann.
READ MORE: Nadal, Djokovic call Wimbledon ban on Russia, Belarus players 'unfair'