MELBOURNE, Australia — Top-ranked Ash Barty built a big lead in her quarterfinal match at the Australian Open before her opponent took a medical timeout and left the court.

More than an hour later, it was Barty heading abruptly through the exit. She was upset today by Karolina Muchova, 1-6, 6-3, 6-2.

Seeded No. 25, Muchova earned her first semifinal berth in a Grand Slam. Her comeback win ended Barty’s bid to become the first Australian woman to win the title in Melbourne since Chris O’Neil in 1978.

“It’s heartbreaking, of course,” Barty said. “But the sun will come up tomorrow. You’re either winning or you’re learning, and today is a massive learning curve for me.”

Muchova’s opponent Thursday will be Jennifer Brady, who beat fellow American and good friend Jessica Pegula 4-6, 6-2, 6-1. Brady reached her second consecutive Grand Slam semifinal.

“I hope I make it a habit,” she said. “Hopefully I have a new habit of making finals.”

Seeded 22nd, Brady struggled at times and gave her racket an angry toss midway through the second set.

The unseeded Pegula, who advanced beyond the third round at a major for the first time in her career, appeared to tire down the stretch.

“We’re such good friends,” Brady said. “I’m really happy for her success. I know we’ll be having a lot more tough battles.”

Daniil Medvedev beat Andrey Rublev, his friend and teammate on Russia’s ATP Cup-winning squad, 7-5, 6-3, 6-2.and will take a 19-match winning streak into the Australian Open semifinals.

“It’s never easy,” he said. “But I mean, we’re all so competitive. During the match, you can see nothing matters. Just need to win ... reach the semis of a Grand Slam.”

The No. 4-seeded Medvedev hasn’t dropped a set to No. 7-seeded Rublev in four tour-level matches. That includes their meeting in the U.S. Open quarterfinals last year.

He called for the trainer after the match to massage his upper legs as he sat in a courtside chair before a TV interview.

“First time. I think I never saw it, also,” he said in the on-court interview. “I went to the bench, last game of the match. I started cramping. I knew he was cramping also. At the end, I locked completely ... three last points when I was getting ready for the serve.”

Medvedev is into the semifinals of a major for the third time. He will next play either 20-time major winner Rafael Nadal or No. 5-seeded Stefanos Tsitsipas.

He’s the second Russian man into the semifinals at Melbourne Park. The No. 114-ranked Aslan Karatsev, a qualifier from Russia who is in the main draw of a major for the first time, will play top-ranked Novak Djokovic for a spot in the final.

Muchova played poorly at the start of her second major quarterfinal, and Barty raced to a 5-0 lead while losing only six points. After nine games, Muchova had one winner and 18 unforced errors, and early in the second set, she took a medical timeout that lasted nearly 10 minutes.

Sunny weather, with the temperature in the mid-80s (30 degrees Celsius), was a factor, Muchova said.

“I think it was a bit of the heat,” she said. “It got to me, and I was feeling kind of dizzy, really lost and almost fainting. I just asked for help.”

Medical personnel took her temperature, checked her blood pressure and gave her ice before she left the court. When the Czech returned, she played much better.

“I tried to play a bit faster rallies so we don’t play long ones as in the first set,” Muchova said, “and it worked well.”

Barty had no complaints about Muchova halting play.

“It’s within the rules,” Barty said. “She’s within her rights to take that time. That shouldn’t be a massive turning point in the match. I’m disappointed I let that be a turning point.”

Comebacks have been a staple in the tournament for Muchova, who rallied in earlier matches to win sets after trailing 5-0 and 4-0.

Against Barty, she began moving into the court to hit her groundstrokes earlier. Barty, pushed behind the baseline, became indecisive and erratic.

During one stretch Muchova won eight of nine games. Barty finished with 37 unforced errors and lost serve four times in the final two sets.

“I just overplayed,” Barty said. “I just pressed a little bit too much, and gave up too many cheap errors at some pretty critical times.”

Muchova’s only other victory over a Top 5 player was against No. 3 Karolina Pliskova at Wimbledon in 2019.

Brady was in a two-week had lockdown before the Australian Open because she was among the players who shared a charter flight to Australia with someone who later tested positive for COVID-19.

The former UCLA star reached her first major semifinal at the U.S. Open in September before losing to eventual champion Naomi Osaka.

Copyright 2021 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.