Williams quickly dropped the first set 6-2 against Ostapenko, the French Open champion. She then rebounded to win the second set 6-3, but quickly fell behind 5-0 while losing the match tiebreaker 10-5.
Williams had not played since winning her 23rd Grand Slam title at last year’s Australian Open while approximately eight weeks pregnant.
“I’m excited. It’s good to be back on the court,” Williams said after the match. “This was such a good time for me. … First matches back are always super-incredibly hard, especially after having a baby. It was great. I was glad I could do it here.”
During her time off the court, Williams gave birth to Alexis Olympia Ohanian Jr. and married her daughter’s father, Reddit co-founder Alexis Ohanian, in November.
Williams has not officially declared that she will play in the Australian Open, which begins Jan. 15. Tournament director Craig Tiley said earlier this month that Williams was “very likely” to defend her title in the first Grand Slam of 2018.