Serena Williams says she sent an apology to Naomi Osaka for her behavior in last year's US Open final.

Williams, who reached the Wimbledon semifinals on Tuesday, said in a Harper's Bazaar magazine article that she wrote to Osaka after not being able to "find peace."

"I started seeing a therapist. I was searching for answers, and although I felt like I was making progress, I still wasn't ready to pick up a racket," Williams said. "Finally I realized that there was only one way for me to move forward. It was time for me to apologize to the person who deserved it the most."

In the interview, which Williams on Tuesday said she did "months ago," she told the Japanese player she was a fan and that she was "truly sorry."

Osaka answered the message, Williams said in the interview.

"When Naomi's response came through, tears rolled down my face," she said.

Williams was given three code violations by chair umpire Carlos Ramos in the US Open final, resulting in the loss of a game. The first came as a result of what Ramos deemed coaching from her box. The second was for smashing her racket, costing her a point. And the third came after she called Ramos "a thief."

On Tuesday, Williams said it "wasn't very easy" going through therapy.

"I've had a lot of things happen to me at that particular tournament in general," she said. "It was just important to always try to better yourself in any way that you can."

The Associated Press contributed to this report.