Hercog, a 28-year-old Slovenian, went all out on her own groundstrokes and homed in on Gauff’s forehand, which has a bigger swing than her compact backhand and is more prone to errors.

“I felt like I had to go bigger, because she was hitting so many forehand winners,” Gauff said. “I knew that I had to hit bigger. I think I was trying to hit too big, to a point where I was missing a lot.”

The first set went by quickly, and the second initially looked like more of the same. Hercog raced to a 5-2 lead and was poised for the win. Serving to stay alive, Gauff saved a match point with a slicing, down-the-line backhand that peeled off the sideline for a winner.

Hercog served in the next game and gained another match point. This time she double-faulted. From then on, this contest was a battle of wills.

In the tiebreaker, Gauff fell behind again. But she began opening her shoulders and hitting with more power, while also reining in errors. When she took the tiebreaker by ending a 32-shot rally with a forehand winner, the crowd went nuts.

“We Brits love our fairy tales, and this is a fairy tale!” a BBC announcer said, surely aware that the match was drawing a large audience. Gauff’s match on Wednesday had been the most watched in Britain from this year’s tournament.

Gauff took an early lead against Hercog in the third set but lost it. With her opponent gaining confidence, Gauff responded by cranking up her power again. She held her last two service games without losing a point.