Djokovic, who was hampered by the injury, thought to be his right wrist, at last month's Monte Carlo Masters where he lost to Roger Federer in the semi-finals, said he hoped to be back for the Rome Masters starting next Sunday.
"I am very sorry for the Madrid tournament and all the Spanish fans to have to pull out," Djokovic said on the ATP website (www.atpworldtour.com).
"I did everything possible in order to play in Madrid, which is one of the biggest events of the year, but unfortunately my right arm injury has flared up again," he added.
"Now I will take some time to recover and heal my injury, hoping I will be ready for Rome. I look forward to returning to Madrid next year."
Djokovic would have had a chance of toppling Rafa Nadal from the number one spot at the clay event in the Spanish capital.
If Spaniard Nadal, who won in Madrid last year, had failed to reach the quarter-finals and Djokovic had triumphed in the final the Serb would have overtaken him at the top of the rankings for the first time since October.
Nadal has been well below his scintillating best on his favoured clay in recent weeks, losing in the quarter-finals at Monte Carlo and Barcelona to compatriots David Ferrer and Nicolas Almagro respectively.
"When you lose, you have a hard moment, you have more doubts," Nadal said at a news conference on Sunday.
"I'm here to fight and to try to play even better," added the 27-year-old.
"I don't think I have to change many things. I think I can change very small things, and the change can be quite drastic and quite big. That's what I'm working on right now.
"When you come from tough moments like this, you come back with a little more intensity to try to be back as soon as possible."
- Sports & Recreation
- Roger Federer