The announcement came not long before Murray was scheduled to take the court against the top-ranked Djokovic in the third round.
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.
There were no further details on Murray’s illness.
Murray, ranked 78th in the world, has been making his way up the rankings since having hip surgery in both 2018 and 2019.