By Ed Osmond
"I'm delighted to be through it's a great result but was a very even match," Djokovic said in a televised interview.
"I played very well to start with but I played one very bad service game and he got back into the match and from that moment on he was the better player.
"I had some very very difficult serve games which I managed to hold."
Qualifier Tomic grew in confidence though and using his patient and delicate groundstrokes to frustrate the Serb, he took the second and opened up a 3-1 lead in the third.
Djokovic had struggled to deal with the low, slow sliced backhands of Tomic but was stunned into action and reeled off seven games in a row to take command.
Tomic, the youngest man to reach the Wimbledon quarter-finals since Boris Becker in 1986, made a string of basic errors but out of the blue he hit back in the fourth set, whipping a ferocious forehand down the line to seal another break.
Djokovic fell heavily at 4-5 and struggled to hold his serve but an exquisite drop shot in the next game set up another break.
The 24-year-old Serb rediscovered his consistency and earned himself two match points in the next game, the first of which he converted when Tomic netted a groundstroke.
"He is a very unpredictable player and has never been in a grand slam quarter-final before and he had nothing to lose and was hitting a lot of winners and I couldn't predict where he was going," Djokovic said.
"He was not making many unforced errors from the baseline which made my life very difficult. I was trying to change the pace, but he was better at that and it was like a game of cat and mouse."
(Reporting by Martyn Herman, editing by Mark Meadows)