As Williams wept, the 19-year-old Andreescu bent down to hug her and a trainer approached as a mic picked up Williams saying she had back spasms. She was down a break at the time.
Williams continued to weep as she addressed the crowd in Toronto after the match. She apologised and vowed "to keep going."
"I'm not a crier," she said, "but ... thank you all."
The match followed the Friday (Saturday NZT) semifinal between Williams and Naomi Osaka, the first match between the two since Williams's emotional outburst in their US Open final last September. Williams won this time, 6-3 6-4. Before Sunday's (Monday NZT) retirement, she was attempting to win her first tournament since giving birth in September 2017.
The US Open starts on August 26, giving the 37-year-old Williams a little over two weeks to get on track.