KEY BISCAYNE, Fla. - Before the first set ended Tuesday, Novak Djokovic had busted a racket in anger, drawn jeers from the crowd and received two code violations, which cost him a point penalty.

There were no further outbursts, and as Djokovic's play improved, so did his mood. He rallied from a break down in the second set and beat Alexandr Dolgopolov 6-7 (3), 7-5, 6-0 in the fourth round of the Miami Open.

"The first set and a half, he was dominating from the baseline," Djokovic said. "I was frustrated and nervous and wasn't showing composure on the court."

Dolgopolov led 4-1 in the second set before Djokovic mounted a comeback to remain in contention for his fifth Key Biscayne title. Dolgopolov required treatment from a trainer after the second set and lost 36 of the final 41 points.

No. 22 John Isner, the last American in the men's draw, reached the Key Biscayne quarter-finals for the first time by outlasting Canadian Milos Raonic in a serving duel, 6-7 (3), 7-6 (6), 7-6 (5). The No. 5-seeded Raonic, from Thornhill, Ont. netted a backhand on the final shot of the match.

Isner, who has yet to be broken in three matches, next faces No. 4 Kei Nishikori, who beat No. 18 David Goffin 6-1, 6-2. Nishikori has lost 10 games in his three matches.

Venus Williams' recent resurgence stalled when she lost in the quarterfinals to No. 12-seeded Carla Suarez Navarro 0-6, 6-1, 7-5. The 34-year-old Williams was broken six times in the final two sets and double-faulted twice in the final game.

"Too many errors, and I was going for it the whole match," Williams said. "Toward the end, I just never found the happy medium between being aggressive and putting the ball in the court."

Williams is a three-time Key Biscayne champion, but her most recent title came in 2001. Her sister, seven-time champion Serena Williams, will play in the quarter-finals Wednesday against No. 27 Sabine Lisicki.

With Rafael Nadal already eliminated and Roger Federer skipping the tournament, the No. 1-seeded Djokovic's most likely opponent in the final would be No. 3 Andy Murray, who became the ninth active man to win 500 matches by beating Kevin Anderson 6-4, 3-6, 6-3.

The milestone made Murray's victory especially sweet. Afterward he was presented with a cake large enough to feed many of the players he has beaten.

Murray will face unseeded Dominic Thiem in the quarter-finals, while Djokovic will play No. 6 David Ferrer.

Others advancing included unseeded Juan Monaco and No. 8 Tomas Berdych, who won when No. 17 Gael Monfils fell, hurt his right hip and retired in the second set.

Djokovic received a warning for ball abuse early in his match, and when he netted a forehand to fall behind 5-4, he slammed his racket against the concrete to earn a second code violation. The crowd hooted as he walked to his chair, and Djokovic raised both arms in response.

"That was a gesture of just feeling bad for what I have done," Djokovic said. "I was fighting a battle inside of myself, I would say. That was the biggest battle that I fought today."

Djokovic quickly regained his composure, but it took him awhile to find his range against Dolgopolov, who slices his groundstrokes as if hitting them with a sand wedge.

"He was playing well," Djokovic said. "He has a very unorthodox game — tricky opponent, mixes up the pace, and can easily get you out of the rhythm."

After the second set, a trainer bandaged the soles of Dolgopolov's feet. He moved poorly after that and won only three of 27 points in the final set.

Murray's round-number victory was more straightforward. He improved to 500-155, becoming the 46th man to reach the milestone during the Open Era, and the first from Britain.

"I don't know why, but getting to 500 gives me motivation to go on and try and win more," Murray said. "I hope I've still got a lot more wins in me."

To beat the 6-foot-8 Anderson, Murray relied on lots of defence and just enough offence. He scrambled all over the court to keep points going, and in the final game made improbable saves to extend rallies on consecutive points, winning both.

When Murray broke for a 3-1 lead in the final set, he screamed "Come on!" loud enough to startle any sunbathers across the street on Crandon Beach. He easily held from there, winning 12 of 13 points in his final three service games.

Murray plays again Wednesday, while Djokovic is off until Thursday and glad to be. He has already played 38 matches this year, which may be why he has dropped a set in each of his first three rounds at Key Biscayne.

"I've played a lot of matches," he said. "It's taking a little bit of a toll mentally on me. I don't feel that I'm very fresh on the court, even though I'm trying. The day off will definitely serve me and help me to recover mentally mostly, because physically I'm fine."