
But he had to take a medical timeout after picking up the injury during the first set of an encounter that stretched to two hours and 41 minutes and which he eventually won 6-3 5-7 6-2 on Tuesday.
The 38-year-old struggled with the heat and medics checked his vitals at one point, as the temperature stayed near 30°C and humidity hovered around 80%.
The Serbian had also vomited during his match against Yannick Hanfmann on Sunday, the same day world No 2 Jannik Sinner retired due to cramps.
Djokovic had called the conditions "brutal" earlier in the tournament.
The fourth seed, who had got the first break of the match to go 3-1 up in the opening set before he hurt his leg, could not break Munar's serve during the second set, which the world No 41 won after a 75-minute battle.
The 24-time Grand Slam winner bent over in exhaustion and needed more medical attention before clinching the decisive third set with two well-timed breaks.
He collapsed on the court after winning the match and is set to face Zizou Bergs in the last eight.
Earlier on Tuesday, an exhausted Emma Raducanu had her blood pressure checked during a medical timeout before retiring while trailing 6-1 4-1 to Ann Li in the Wuhan Open first round, with the temperature nearing 35°C on a humid afternoon.
The conditions forced play to be suspended on all outdoor courts on Monday, when Raducanu, of Britain, posted a screenshot of her phone screen on social media, displaying a temperature of 34°C.
The ATP said it would consider introducing a formal heat rule.