Hewitt looked down and out at two sets and 3-0 down but he stormed back to take the contest to a fourth set in which the world number one showed battling qualities of his own to edge through 6-1 6-3 4-6 6-3 in nearly three hours.
For so long, it was one-way traffic with Hewitt looking flat and tired after his exertions against Andy Roddick and Milos Raonic in the previous rounds.
And Djokovic took full advantage, three breaks handing him the first set and three more moving him two sets up.
And when he won the first three games of the third, it seemed just a matter of time before victory was secured.
But, from nowhere, Hewitt found some form and, all of a sudden, Djokovic looked rattled. The 30-year-old from Adelaide, twice a grand slam champion, dragged it back to 3-3, broke again for a 5-4 lead and then served it out.
And when Djokovic faced another break point in the third game of the fourth set, the comeback looked set to continue. But the Serbian held his nerve to win the game and with that he regained the momentum.
He claimed the Hewitt serve to go 4-2 up and it proved a lead he would not relinquish.
"I have to give credit to my opponent who never gives up," said Djokovic.
"He's a great competitor and he kept on making me play an extra shot. I made a couple of unforced errors and he got back into the match. I have a lot of respect for him.
"For two sets and 3-0 I was playing really well and then I stopped moving but credit to him, he wasn't making any unforced errors."
Next for Djokovic is a meeting with fifth seed David Ferrer in the last eight.