The 23-time Grand Slam champion, whose long-awaited return from injury this year ended in an early exit at Wimbledon, beat world number 57 Nuria Parrizas Diaz 6-3 6-4 in just under two hours in the first round of the National Bank Open in Toronto.
It was the first time 40-year-old Williams, in only her second appearance of the year, had won a singles match since beating Danielle Collins at Roland Garros on June 4, 2021.
Afterwards, she dropped a bombshell hint about her possible retirement in the post-match press conference.
"I guess there's just a light at the end of the tunnel," Williams said.
"I don't know, I'm getting closer to the light. Lately that's been it for me. I can't wait to get to that light."
Asked what she was referring to when she was talking about the 'light' at the end of the tunnel, Williams said, "Freedom."
"I love playing, though... but, you know, I can't do this forever," she added.
"Sometimes you just want to try your best to enjoy the moments, and do the best that you can."
Williams' comments have added further fuel to the rumour that she is planning on bowing out of the game after her home event, the US Open, which is scheduled to take place from August 29 to September 11.
Elsewhere in Toronto, Wimbledon champion Elena Rybakina won her first match since her triumph at the All England Club, although she needed three hours to overcome Marie Bouzkova 7-5 6-7 6-1.