(CNN) Serena Williams had to leave the Rogers Cup final in Toronto early Sunday, plagued by back spasms, the Women's Tennis Association said.

The 23-time Grand Slam champion made it though four games of the opening set, but was forced to retire from the match when the pain became too much, WTA said.

Her opponent, 19-year-old Bianca Andreescu, took the title in front of a hometown crowd. But instead of immediately celebrating, Andreescu rushed to comfort Williams, who was visibly upset on the sideline.

Canada's Bianca Andreescu, left, consoles Serena Williams, of the United States, after Williams had to retire from the final of the Rogers Cup tennis tournament in Toronto on Sunday.

"I started tearing up because she was tearing up," Andreescu said during a post-match press conference . "It's because I know how she feels. Injuries really, really suck."

The young player, who had been nervous to face the legendary champion on the court, ended up giving Williams a pep talk.

Read More