INDIAN WELLS, California: Serena Williams withdrew before her semifinal at the BNP Paribas Open on Friday night with a right knee injury, 14 years after her sister Venus did the same thing and triggered an angry reaction from fans that drove Serena to boycott the tournament.

The world’s top-ranked player was to play third-seeded Simona Halep in the second semifinal. Williams addressed the crowd on-court after Jelena Jankovic defeated Sabine Lisicki 3-6, 6-3, 6-1.

“A couple days ago at practice I really injured my knee,” Williams said. “Today I was struggling just to even walk.”

At first, neither the announcer nor Williams informed the crowd that she had withdrawn from the tournament. He asked the crowd for a round of applause “for this young lady we love very much” when she came out.

After Williams’ brief comments in which she didn’t clarify she had withdrawn, fans applauded with only a few boos. As she walked off, the announcer told the fans that she wouldn’t be playing and he apologized. Williams stopped to sign some autographs on her way off court.

Williams was back at Indian Wells for the first time since 2001, having ended her boycott that began after she won the title in 2001 as a 19-year-old and was heavily booed. She was supposed to play Venus in the semis, and Venus withdrew 20 minutes beforehand with a knee injury, angering the crowd.

Serena went on to win the title, but fans booed her throughout the match and she vowed never to return to the desert event. The sisters’ father, Richard, later said he heard racial taunts and there was speculation at the time that he decided in advance which sister would win their matches against each other.

Williams announced the news on her Instagram account while the first semifinal was in the third set, shortly after tournament officials confirmed it.

“4 months ago I began a journey to play Indian Wells and it was amazing. I never dreamed I could do it,” she wrote. “But I would not have been able to do this without my fans. Though it ended early due to injury this year, I have to say I cannot wait to try again next year. Thanks everyone. I love you so much!“

Halep advanced to Sunday’s final via walkover.

Roger Federer defeated Tomas Berdych 6-4, 6-0 and Milos Raonic outlasted Rafael Nadal 4-6, 7-6 (10), 7-5 in a nearly three-hour marathon to set up a semifinal showdown.

Federer improved to 15-1 this year, with his only loss coming against Andreas Seppi in the third round of the Australian Open. Federer avenged that defeat in the same round at Indian Wells. He earned his first straight-set win over Berdych since 2011 in Paris and just his second 6-0 set ever in 19 career matches against the Czech.

“I’m not the kind of guy who takes great joy out of bageling opponents, to be honest,” said Federer, seeking a record fifth title in the desert.

He needed just 68 minutes to advance to the semis against the sixth-seeded Raonic.

Top-ranked Novak Djokovic takes on fourth-seeded Andy Murray in the other men’s semifinal on Saturday.

Raonic beat three-time Indian Wells champion Nadal for the first time in six career meetings, firing 18 aces and hitting 48 winners to 25 winners for Nadal, who had 22 unforced errors.

“It’s really great what I was able to do today and I’m very happy with it, but I don’t let myself get caught up because this isn’t where it ends,” Raonic said. “There is a lot more that I want to achieve this week.”