WIMBLEDON, England — Slowed by a balky ankle, trailing by a service break in the third set of her Wimbledon quarterfinal, Serena Williams appeared to be in trouble Tuesday against an opponent playing the tournament of her life.

Williams was down, yes. But out? No way. And now she is two victories from that 24th Grand Slam title that’s been barely eluding her.

Lifting her play a much-needed notch down the stretch to grab the last three games, capping the comeback with her 19th ace — at 121 mph, no less — Williams reached the semifinals at the All England Club by gutting out a 6-4, 4-6, 6-3 win over 55th-ranked Alison Riske.

“I had to just button up and play hard,” said Williams, who owns seven Wimbledon titles. “She was playing her heart out.”

That she was. Riske, a 29-year-old from Pittsburgh, was appearing in her first major quarterfinal. For Williams, this was No. 51.

That might have made all the difference. It’s Williams who possesses boundless muscle memory in these situations, who knows what it takes to come through in the tightest contests on the biggest stages.

“I definitely thought maybe I had a peek here and there at a couple openings, but Serena really upped her level, as only a champion would,” Riske said.

“It was really, actually, very interesting for me to be on the opposite end, because I felt her up her game and her intensity,” Riske said with a smile. “Yeah, I hope she takes the title now.”

Next for the 37-year-old Williams will be a match against 54th-ranked Barbora Strycova of the Czech Republic, who reached her first Grand Slam semifinal at age 33 with a 7-6 (5), 6-1 victory over No. 19 Johanna Konta of Britain. The other semifinal Thursday will be No. 7 Simona Halep of Romania against No. 8 Elina Svitolina of Ukraine.

Halep, a former No. 1 who won the 2018 French Open, followed up her elimination of 15-year-old sensation Coco Gauff by defeating Zhang Shuai of China 7-6 (4), 6-1 to get to her second semifinal at Wimbledon. Svitolina will make her debut in that round at any major tournament thanks to beating Karolina Muchova of the Czech Republic 7-5, 6-4.

These sorts of stakes, and this sort of setting, are unfamiliar for Riske, who mistakenly headed to her changeover chair thinking the match’s fifth game was over when the score was just 40-15.

Spectators chortled; she grinned and walked back to the baseline.

And so even if Williams was hardly perfect, she did get by, aided by her greatest-in-the-game serve and Riske’s miscues. Most glaringly, Riske double-faulted five times in the final set, at least somewhat a result of trying to do too much against William’s superb returns.

“It’s no secret that Serena has an amazing serve. But Serena has an equally-as-amazing return,” Riske said. “I’ve never played anyone that has a return like Serena. That put a lot of pressure on my serve.”

Still, Riske played tremendously well for most of the afternoon, just as she did while going 14-1 on grass in 2019 until Tuesday.

She won two of Williams’ first four service games and finished 5 for 5 on break points. Her deep and flat groundstrokes off both sides jarred Williams repeatedly. Until, that is, Riske wilted late — which was understandable, given that she became the first woman in Wimbledon history to play three-setters in five consecutive matches to open the tournament, according to the WTA.

Williams rolled her right ankle and her movement was hardly ideal. Late in the second set, she was visited by a trainer, who applied extra tape to the ankle. That was during a stretch when Riske, talking to herself between points, claimed four games in a row to take the second set and lead the third by a break at 1-0.

“I thought,” Riske said, “I was very close.”

Not close enough. Williams was not going to go quietly. She held at love to lead 4-3, and then came the key game. Riske saved a trio of break points and was a point from 4-all after claiming a point when Williams slipped along the well-worn baseline.

First Williams got back to deuce by using a drop shot to set up a volley winner. Then she earned yet another break point on a thrilling 10-stroke exchange, using a drop shot to bring Riske forward and delivering a volley winner. Williams lifted both arms and jutted her jaw. In the stands, her husband leaped from his seat, pointed his index fingers at her and screamed.

On the next point, Riske double-faulted, handing over the last break Williams needed.

After breaking Steffi Graf’s record for most Grand Slam trophies in the professional era by winning her 23rd at the 2017 Australian Open while pregnant, Williams took time off. Since returning to the tour last season, she came close to equaling Margaret Court’s Slam count of 24 — which was accumulated in part against amateurs — but lost in the finals at Wimbledon and the U.S. Open.

Williams dealt with injuries and illness this year, playing just 12 matches until last week.

“This is the first time since (January) that I actually felt, like, good,” she said at her news conference, while her daughter, Olympia, was held by Williams’ agent at the back of the room. “It’s been a really, really long year for me already, and hard year.”

That’s true. Also true: She’s Serena Williams.

And so here she is, back in Wimbledon’s semifinals for the 12th time.

“She’s something,” Riske said, “our sport has never seen before.”