MIAMI — Daniil Medvedev could barely walk, much less run. He could still serve, though.

The top-ranked Medvedev held his final two service games despite being hobbled by cramps and beat Alexei Popyrin 7-6 (3), 6-7 (7), 6-4 in the third round at the Miami Open.

Medvedev said the victory brought a special sort of satisfaction.

"Winning a Grand Slam final in straight sets doesn't feel the way I felt after the match point today," he said with a grin. "A match to remember for sure."

Medvedev failed to convert three match points in the second set after taking a 5-2 lead. An hour later the Russian was still playing, and on a humid afternoon with temperatures in the mid 80s, he paid a price.

He broke in the final set for a 4-3 lead, but by then he was limping around the court.

"I felt like my legs were not following me anymore," Medvedev said. "The only thing I was thinking about is not to fall down, because if you fall down, I don't think I would be able to get up. There were a few moments I just wanted to lay down and say, 'OK, it's over.' That's the thing I couldn't accept myself to do."

To keep rallies short, Medvedev began hitting high-risk shots, and made enough of them — serves especially — to close out the 2 1/2-hour match.

When Popyrin misfired on a backhand on the final point, Medvedev shuffled to the net with a smile that turned into a wince.

"My serve saved me," Medvedev said. "Thanks a lot to my serve."

Also advancing was No. 18-seeded John Isner, the only former Miami champion in the men's field. On the women's side, No. 2 Naomi Osaka advanced with a walkover, but No. 4 Sofia Kenin lost to No. 27 Ons Jabeur 6-4, 4-6, 6-4.

Popyrin, a 21-year-old Australian ranked 86th, second-guessed himself for not making Medvedev move more at one juncture. But Popyrin credited his good friend and practice partner for closing out the win.

"I saw he couldn't walk at all," Popyrin said, "but he was bombing 120-mph serves. He was definitely struggling out there. Props to him that he was able to serve it out."

Medvedev said he felt fine two hours after the match, aside from soreness in his legs, and expects no issues going forward. He'll have two days to recover before his fourth-round match.

Isner never had a break-point opportunity and won anyway, which is the kind of feat typical of Isner. The big American with the big serve hit 16 aces and edged No. 11-seeded Felix Auger-Aliassime 7-6 (5), 7-6 (5).

That made it four consecutive sets Isner has won by tiebreaker against Auger-Aliassime in Miami. The score when they met in the 2019 semifinal was 7-6 (3), 7-6 (4).

In the rematch, neither player had a break point, which meant the outcome was determined by a handful of shots. Isner likes such matches — sometimes.

"I enjoy it when I win," he said. "It's frustrating when you lose a match that comes down to point here or there, and a lot of times that's how it is for me. I could very easily be talking now as a loser and be going home."

Said Auger-Aliassime: "I guess 6 and 6 is a pretty common score against John. It slipped out of my hands. It was a close one."

Osaka advanced to the fourth round at Miami for the first time in her career when qualifier Nina Stojanovic withdrew from their match shortly before the scheduled start because of a right thigh injury.

Osaka, ranked No. 2, has won 22 consecutive matches since her most recent defeat in February 2020, and she earned her fourth Grand Slam title at the Australian Open last month. But in Miami, where she is making her fifth appearance, she has previously made early exits.

She'll next face No. 16 Elise Mertens, who won a seesaw match against No. 22 Anett Kontaveit, 6-2, 0-6, 6-2. No. 29 Jessica Pegula defeated No. 6 Karolina Pliskova for the third time this year, 6-1, 4-6, 6-4.

In other men's play, No. 7 Roberto Bautista Agut rallied past No. 31 Jan-Lennard Struff 4-6, 6-3, 6-2. Bautista Agut will face Isner next.

"I'm going to have to play well if I'm going to have any chance of beating him," Isner said. "He's too solid if I don't."

___

More AP tennis: https://apnews.com/hub/tennis and https://twitter.com/AP_Sports