MIAMI — Novak Djokovic pulled a spare ball from his pocket, angrily whacked it against the backstop and then pounded his unco-operative racket into the concrete.

He lost his temper, but not the match. Annoyed after squandering a second-set lead, Djokovic regrouped and beat Federico Delbonis 7-5, 4-6, 6-1 Sunday in the third round of the Miami Open.

Djokovic appeared on his way to an easy victory when he led 3-1 in the second set, but he dropped serve twice in a row. He then steadied himself to win a succession of long rallies and sweep the last five games.

"We were very close in the beginning of the third set," he said. "It could have gone a different way."

The top-ranked Djokovic is trying for his seventh title at the Miami Open, which moved this year to the Dolphins' complex.

On the women's side, defending champion Sloane Stephens lost to Tatjana Maria 6-3, 6-2. Venus Williams, who is a three-time Miami champion but unseeded, beat No. 14 Daria Kasatkina 6-3, 6-1.

Defending men's champion John Isner was broken in the first game but he held the rest of the way and hit 16 aces to beat Albert Ramos-Vinolas 7-5, 7-6 (6).

Isner, now 33, won the biggest title of his career in the tournament a year ago. Seeded No. 7, he'll next face No. 19 Kyle Edmund, who beat No. 12 Milos Raonic 6-4, 6-4.

Djokovic's fourth-round opponent will be No. 22 Roberto Bautista Agut, who eliminated No. 15 Fabio Fognini 6-4, 6-4.

"I'm hitting the ball well," Djokovic said. "I just need a little more consistency to hold that level of play the entire match."

Crowds on the outer courts were again large and festive, but the atmosphere in the vast stadium was more subdued, with the stands only half full for Djokovic's match.

"It's a unique stadium in tennis," he said. "It's obviously different from anything we've experienced before. It's not a tennis venue. We're guests here of the Miami Dolphins."

Williams advanced to the fourth round of the tournament for the 16th time. She lost serve four times against Kasatkina but won every return game, going 8 for 8.

"I've never had a match like that before in my life," she said. "There's always a time for a first. I'm returning really well."

Williams won the title in 1998, 1999 and 2001. She's unseeded at Miami for the first time since 2012 but seems to be enjoying herself, smiling often — including when Kasatkina hit a shot between her legs.

"I never smile on the court, and this week I've smiled a lot," Williams said. "There's a lot to smile for. That's all I can say."

She next faces No. 2 Simona Halep, who outlasted Polona Hercog 5-7, 7-6 (1), 6-2.

"I was running like crazy for three hours," Halep said. "If I keep doing this, I think I have a chance to be back No. 1."

A loss Saturday by top-ranked Naomi Osaka opened the door for Halep to reclaim the top ranking if she reaches the final.

Stephens, seeded No. 4, was beaten by a player outside the top 50 for the third time this year. Another American, No. 25 Danielle Collins, lost to Wang Yafan 7-5, 6-1.

___

More AP tennis coverage: https://apnews.com/tag/apf-Tennis