It was the 21st time that Serena Williams had played Wimbledon. It was Harmony Tan’s first time, but Tan will be the player heading to the second round at the All England Club.

Tan, a Frenchwoman ranked 115th who is little-known even in her country, defeated Williams, the greatest women’s tennis champion of her era, 7-5, 1-6, 7-6 (10-7). Williams had not played a singles match on tour since retiring in the first round of last year’s Wimbledon in tears with a hamstring injury, but she got to play plenty of tennis Tuesday evening on the Center Court where she had won seven Wimbledon singles titles. Her grueling duel with Tan was a stylistic contrast that lasted three hours and 11 minutes. What was missing for Williams was the upbeat, reaffirming finish, and she did not hesitate when asked if she was OK with this being her final Wimbledon memory if that was the way it turned out.

"Obviously not. You know me. Definitely not,” Williams said. "But today I gave all I could do, you know, today. Maybe tomorrow I could have gave more. Maybe a week ago, I could have gave more. But today was what I could do. At some point, you have to be able to be OK with that. And that’s all I can do. I can’t change time or anything.”

She did succeed in changing the momentum Tuesday in a match that was played under open skies for the first set and then under cover the rest of the way after the roof was closed to provide the stadium lighting necessary to continue. Williams dominated the second set but Tan fought back in the third while Williams’ level and energy dipped even if her fighting spirit did not.

Although she saved a match point on her serve late in the final set and jumped out to a 4-0 lead in the super tiebreaker, which is new at Wimbledon this year, she could not hold on, missing too many crucial shots, including a forehand into the net on Tan’s second match point.

"I think physically I did pretty good,” Williams said. "I think the last couple points, I was really suffering there, but I feel like in just those key points, winning some of those points, is always something mentally that you have to have, that you kind of need. I did pretty good on maybe one or two of them, but obviously not enough.”

Tan’s clear-thinking poise under big-match pressure was remarkable for a player with so little experience and who was making her first appearance on Center Court. But she said she had to struggle within herself to believe that she really could defeat Williams.

"When I saw the draw I was really scared, because it’s Serena,” said Tan, 24. "She’s a legend, and yeah, I was like, ‘Oh my God, how can I play?’ If I can win one or two games, it was really good for me.”

She won two sets instead, turning what could have been a feel-good story for Williams into a narrow defeat that will re-pose the question of how much more professional tennis Williams intends to play. She will turn 41 in September, and her quest for a record-tying 24th Grand Slam singles title seems increasingly far-fetched. A longtime No. 1, she is ranked 1,204th and will soon have no ranking at all. But she provided no definitive answer to whether this was her final Wimbledon appearance.

"That’s a question I can’t answer,” she said. "I don’t know. Who knows where I’ll pop up?”

At least she can leave the All England Club with a less painful memory than what she took from last year’s Wimbledon, when she tore a hamstring after slipping in the first set of her first-round match with Aliaksandra Sasnovich, hobbling off Center Court in great distress. She did not play competitively again until last week when she returned to play doubles in Eastbourne, England, with Ons Jabeur. Tuesday’s match against Tan was Williams’ first singles match in a year, and to her credit, she scrapped and hustled through the peaks and valleys.

"It was definitely long, a very long battle and fight and definitely better than last year,” Williams said.

From the start, Tan had Williams guessing and stretching, mixing often-exquisite drop shots with forays to the net; towering lobs with counterpunched backhand passing shots; sideswiping forehand slices with looped topspin.

"Any other opponent probably would have suited my game better,” said Williams, who was rarely able to settle into power-baseline duels or any particular pattern of play for long.

No one but Tan knew what was coming. Williams, who has lost to such variety-loving players even in her prime, often looked befuddled in the early going. She also looked as tight as piano wire, struggling to let her natural power flow and missing swing volleys and approach shots by the bunch while laboring to move laterally.

That was certainly understandable in light of her long layoff, and the crowd reacted with awkward silence at first. The grand tennis theater where Williams has experienced so many highs and a few lows through the decades was nearly half empty at the start but as the match turned into a marathon, it was filled with support and emotion as Williams tried to avoid only the third first-round exit of her career in a Grand Slam tournament.

She could not quite manage it, despite all her evident desire, and there may not be many more major tournaments to come, although Williams did not rule out a return to the U.S. Open, where she won her first Grand Slam singles title in 1999 at age 17.

"Your first time is always special,” she said, speaking slowly and softly. "There’s definitely, you know, lots of motivation to get better and to play at home.”

This article originally appeared in The New York Times. © 2022 The New York Times Company