Wimbledon, England (CNN)A tense Novak Djokovic flirted with disaster against Kevin Anderson at Wimbledon on Tuesday, but the defending champion finally overcame the towering South African to reach the quarterfinals.
Wimbledon 2015: Novak Djokovic in quarterfinals after comeback win
The duo returned to Court One after the fourth-round contest was halted on Monday night due to darkness following the fourth set, and Djokovic was in serious trouble when staring at two break points in the fourth game of the decider.
But the world No. 1 forced an error and saw a return go long, held serve and then broke Anderson's fearsome delivery in the penultimate game.
The 28-year-old, who had been on the receiving end of 40 aces from the 14th seed, triumphed 6-7 (6-8) 6-7 (6-8) 6-1 6-4 7-5 in southwest London.
He called it one of the most difficult matches of his career.
"All in all, until the last moment, until the last point, I didn't know if I was going to win or not," Djokovic told reporters. "I was just trying to be very active and come with the right intensity. That's all I could influence."
Djokovic now faces a quick turnaround, having to play U.S. Open champion Marin Cilic on Wednesday. The last time he was in the same position at a grand slam -- not having a day off while his opponent did -- he fell in the French Open final to Stan Wawrinka.
"I think I'm going to be fine for tomorrow," said Djokovic. "I think I haven't spent too much energy throughout this tournament. Of course, this match was by far the toughest I had so far.
"Let's see. I'm confident I can feel good."
The Serb will still be the considerable favorite, since he owns a 12-0 record against the Croat. Cilic did, however, take Djokovic to five sets at Wimbledon 12 months ago.
"I'm going to have to be more aggressive, to play more risky tennis," Cilic told reporters Monday as he looked ahead to a possible meeting with Djokovic. "Of course that leaves less margins for error, but that's the way I was playing last year.
"I think this would be the best opportunity for me to try to play, you know, full on."
Djokovic pulled off his fourth victory from two sets down and improved to 25-8 in fifth sets by edging Anderson, who was attempting to become the first South African male to reach the last eight at Wimbledon since Wayne Ferreira in 1994.
Anderson is a consistent performer, generally beating players lower ranked than him, but getting the better of the elite at majors is still proving difficult. He became the first man in the Open Era to lose in the round of 16 seven times at a grand slam without ever landing in a quarterfinal.
"I think really gave myself a good shot," the 6-foot-8-inch Anderson told reporters. "I played some good tennis. But on the flipside, also disappointing. Coming into this week, it was definitely my goal to progress further than I have at the slams. Been in the round of 16 a few times."
When he held the two break points at 2-1 in the fifth, the odds swung in his favor. But Djokovic averted danger, and then again when serving at 2-3. In that sixth game, his frustration growing, he screamed loudly after a point and appeared to startle a ball girl.
"I'm definitely going to try to apologize to her if I did something wrong," said Djokovic, who said sorry to a ball boy in April after a similar incident.
Anderson began the 11th game with his final ace but subsequently came unstuck, striking two double faults from 15-all. Djokovic broke with a low, block forehand return that Anderson could do little with as he served and volleyed.
Anderson let Djokovic off the hook in the final game, blowing a 0-30 advantage and sending two manageable returns well long.
By this time the rain that forced a 30-minute delay Tuesday gave way to sunshine, matching Djokovic's mood when the battle concluded.