World number one Novak Djokovic survived a huge scare as he edged to a five-set win over Gilles Simon at the Australian Open in a clash lasting over four hours.
The Serbian looked out of sorts for long periods on Rod Laver Arena but fought out a 6-3 6-7 (1-7) 6-4 4-6 6-3 victory in the fourth round on Sunday.
Djokovic, a five-time champion in Australia and last year's winner, advanced to a quarter-final meeting with Kei Nishikori after needing four hours, 32 minutes to get past Simon.
It marked the 10th consecutive time Djokovic has beaten the Frenchman, but the 10-time grand slam champion never reached the high levels he has set.
The win extended Djokovic's run of reaching at least the quarter-finals at grand slams to 27 consecutive tournaments.
Djokovic was wasteful, error-prone - he had 100 unforced errors - and uncharacteristically unreliable from the baseline, from which he won 113 of 244 points, but he still reached a ninth straight Australian Open quarter-final.
It was expected to be a hard-fought battle from the back of the court and it delivered.
Djokovic coughed up a break lead in the first set before going 5-3 up when Simon played a poor game to drop serve.
He made no mistake consolidating his second chance, taking the first set in 58 minutes despite being well below his best.
Djokovic's problems continued into the second and missed opportunities proved costly as he wasted 11 break points before Simon capitalised in the tie-break to level the match.
The duo traded breaks early in the third, Djokovic failing to consolidate his as he coughed up serve to love.
Djokovic's next break would come at the perfect time as Simon netted a backhand to lose the set in the 10th game.
His errors continued to cause problems and Simon broke in the ninth game of the fourth set before serving it out.
The fourth game of the fifth set proved decisive as Simon gave up serve from 40-0 up thanks to three consecutive unforced errors.
Simon, the 14th seed, then fell 5-1 behind as Djokovic saw out a dramatic win, but not before giving up serve once more.
Djokovic  bt Simon  6-3 6-7 (1-7) 6-4 4-6 6-3
Djokovic - 9
Simon - 2
Djokovic - 62/100
Simon - 32/68
BREAK POINTS WON
Djokovic - 6/25
Simon - 4/18
FIRST SERVE PERCENTAGE
Djokovic - 62
Simon - 66
PERCENTAGE OF POINTS WON ON FIRST/SECOND SERVE
Djokovic - 70/55
Simon - 69/36
Djokovic - 195
Simon - 174