Serena Williams sparred with an umpire over a warning for coaching, being penalized first a point, then a game, before eventually losing the US Open Women's final to 20-year-old Naomi Osaka, 6-2, 6-4.

Williams, who was vying for her 24th Grand Slam singles title, later said she was fighting for the next woman who wants to be strong, adding "maybe it didn't work out for me, but it might for the next person."

The heated dispute with the chair umpire began after he said he witnessed coaching from Williams' coach -- a code violation -- in the second game of the second set and gave her a warning.

Timothy A. Clary/AFP/Getty Images

Serena Williams smashes her racket while playing against Naomi Osaka of Japan during their Women's Singles Finals match at the 2018 US Open in New York, Sept. 8, 2018.

"I don't cheat to win," she shouted at the umpire. "I would rather lose."

She continued to argue with the umpire, accusing him of questioning her integrity and of punishing her more harshly than male players are who swear and argue with officials on court.

"I have a daughter and I stand for what is right," she said. "I have never cheated."

She was assessed a second violation after she slammed her racquet following her loss in the fifth game of the second set, which cost her a point.

Williams repeatedly demanded the umpire apologize, but when she called him a "thief," he hit her with a third code violation, costing her a game penalty, which put her down 3-5.

Adam Hunger/AP

Serena Williams talks with chair umpire Carlos Ramos during a match against Naomi Osaka, of Japan, in the women's final of the U.S. Open tennis tournament, Sept. 8, 2018, in New York.

Williams appealed to U.S. Open referee, who, according to the U.S. Open, was not authorized to review the call. She returned to serve and won the next game, playing perhaps her best tennis of the match, to make the set 4-5.

But Osaka regained the dominating form she'd shown in the first set, and closed out the tennis legend and new mom in the next game.

Osaka made history by becoming the first Japanese player to ever win a Grand Slam title.

Andres Kudacki/AP

Serena Williams serves to Naomi Osaka, of Japan, during the women's final of the U.S. Open tennis tournament, Sept. 8, 2018, in New York.

After the match, Williams hugged Osaka, but the newly crowned U.S. Open champion sat down and cried quietly.

During the trophy presentation, the crowd continued to boo, causing Osaka to cry again on the stage.

Williams didn't address the controversy, but defended her opponent.

"Well I don't want to be rude but I don’t want to do questions. She played well," Williams said, referring to Osaka. "This is her first grand slam. I know you guys were rooting ... let's not boo anymore ... congratulations Naomi ... I hope to play here again."

Osaka acknowledged that she was not the fan favorite and that "everyone was cheering for" Williams.

Julian Finney/Getty Images

Naomi Osaka of Japan returns the ball during her Women's Singles finals match against Serena Williams on Day Thirteen of the 2018 US Open, Sept. 8, 2018, in New York.

"I'm sorry it had to end like this," she said. "I just want to say thank you for watching the match ... it was always my dream to play Serena at the U.S. Open finals ... I am grateful. Thank you."

Williams got emotional during the press conference afterward and comforted Osaka because "she's crying and she just won."

"I felt like, 'Wow, this isn't how I felt when I won my first Grand Slam,' so I was like, I definitely don't want her to feel like that," Williams said. "Yeah, maybe it was the mom in me that was like, 'We've got to pull ourselves together here.'"

The Women's Tennis Association issued a statement congratulating both players, but said, "There are matters that need to be looked into that took place during the match."

The US Open said that Williams was assessed a "Code Violation," resulting in a warning, because the chair umpire "witnessed coaching taking place from Williams' coach."

Williams "made it clear she did not receive any coaching," but her coach admitted to coaching, the US Open's statement said.

She was assessed a second violation, which cost her a point, for "racquet abuse," the statement said.

The third violation was for "verbal abuse in the judgment of the umpire, which required a game penalty," according to the statement, which said the decision was not reviewable by the officials who were called down to the court.