Williams struggled with her serve, and Ostapenko won, 6-2, 3-6, and then, 10-5, in a supertiebreaker. But Williams was still impressive in taking a set off the seventh-ranked Ostapenko after nearly a year away from tennis.
After the 67-minute match, Williams said that she was still undecided on her title defense of the Australian Open, which starts Jan. 15, but delivered a warning to rivals.
“I don’t know if I am totally ready to come back on the tour yet,” she said. “I know that when I come back I definitely want to be competing for championships. I am definitely looking forward to getting back out there.
“I am taking it one day at a time. I am going to assess everything with my team before deciding.”
Williams, 36, formerly ranked No. 1 in the world, had not played since she won the Australian Open, her 23rd Grand Slam singles title, a record for the professional era, 11 months ago. She was pregnant during that tournament and took time off to give birth to her first child, Alexis Olympia, in September. She married Alexis Ohanian, a co-founder of Reddit, in November.
“Knowing that I have won 23 Grand Slam titles and several other titles, I don’t think I have anything more left to prove,” Williams said. “But I am not done yet.”
Despite winning her opening game when she broke Ostapenko, Williams was nowhere near her best in the first set, before fighting back and winning the second.
After the initial break, Ostapenko latched onto the weak serves of Williams, and several unforced errors helped, as she stormed back into the match to go up, 4-1, with two breaks.
Williams struggled with her serve in the second set too, but went ahead, 3-0, with a couple of early breaks as she started to hit more confident shots, including several crowd-pleasing double-handed passing shots. Another break in the ninth game delivered her first set of the comeback.
“In the beginning, it felt a little tough,” she said. “But as the match moved on, I was less afraid. I knew I was not going to fall over and break. The more I played, the more confident I felt that I would be able to go for shots that I was afraid to go for in the first set.”
In the supertiebreaker, Ostapenko raced to an 8-2 lead before quelling a brief recovery by Williams.
Williams said she was delighted with the way she competed.