Djokovic dropped five straight games from 2-0 up in the second set and had to dig deep against the gritty Spaniard, whose speed across the court saw him retrieve countless shots.

Djokovic trailed 15-40 serving in the ninth game of the decider but held his nerve. The Serb sealed victory with a cross-court volley at the net.

"I could have easily lost this match. I cannot allow myself many more (matches like this) if I want to go far in this tournament," Djokovic said.

Murray, returning from a right elbow injury which sidelined him during the Miami Open and Davis Cup quarterfinals, struggled on his serve in a scrappy match lasting more than 2 1/2 hours. The match featured 13 service breaks, including seven against Murray.

"I'm disappointed to lose from the position that I was in," said Murray, last year's French Open runner-up to Djokovic. "I haven't lost many matches like that in my career."

Ramos-Vinolas, of Spain, celebrated his first win over a world No. 1 in four chances.

Three-time Grand Slam winner Wawrinka never found his touch or range and conceded match point when his backhand pass -- normally one of the best shots in men's tennis -- clipped the net and went out. Cuevas hit a sweet forehand winner down the line on the next point and raised his arms after beating Wawrinka in their first-ever meeting.

"Being 4-love up in the third, I haven't lost many matches like that in my career," Andy Murray said after his third-round loss to Albert Ramos-Vinolas on Thursday. Yann Coatsliou/AFP/Getty Images

Zverev pushed Nadal to five sets in the third round of the Australian Open but the only fire Zverev showed here was when he smashed his racket clean in two during the second set.

"Australia was five sets. Last year in Indian Wells was very close in the third (set), he had match point," Nadal said. "Before the match, I thought it was going to be a big test for me."

Zverev conceded the match tamely, double-faulting on Nadal's third match point. Nadal reiterated his belief that Zverev has the potential to become No. 1.

When Djokovic entered the court last, the weather was already becoming chilly.

He beat Carreno Busta 6-0, 6-1 here three years ago in the third round _ their only previous meeting _ but this was totally different.

Djokovic broke for 4-2 in taking the first set.

But at 2-0 up in the second set, the sloppiness kicked in and Carreno Busta served it out to level the set score. Or rather, Djokovic gifted him the decisive point, missing an easy shot for deuce with a weak shot at the net.

Djokovic double-faulted on the first point of the third set, hit a wild forehand long to trail 0-30, and looked mightily relieved when he held serve. The 12-time Grand Slam champion was clearly not at his best and far too wasteful.

After finally breaking for 4-2 in the decider with a forehand winner down the line, he was broken straight back.

In the end, resilience got him through.

Djokovic next plays No. 10 David Goffin of Belgium in the quarterfinals. He leads Goffin 5-0 in career matches.