PARIS — Serena Williams laughed at herself, screamed at herself, violently shook her uncooperative racket and cocked it over her head, threatening to fling it before she changed her mind.
Williams finally found a way out of her funk — and into the French Open semifinals.
She came from behind in the third set Tuesday and advanced to Roland Garros’s final four for the first time since 2003 after she defeated Svetlana Kuznetsova, 6-1, 3-6, 6-3.
Williams had been beaten the last four times she reached the French Open quarterfinals, most recently in 2010. The 15-time Grand Slam champion, who is ranked No. 1, won her only Roland Garros title in 2002.
Against Kuznetsova, Williams overcame an inconsistent serve, erratic groundstrokes and a 2-love deficit in the final set, winning five consecutive games and then closing the victory with a forehand winner and a scream.
‘‘Yes!’’ she hollered.
It was the first real test of the tournament for Williams, who lost 10 games after losing a total of 10 games in her four earlier matches. She extended her career-best winning streak to 29 consecutive matches.
In a post-match on-court interview, Williams seemed spent.
‘‘I’m very happy to have won this quarterfinal because the whole night I was afraid of my quarterfinal match,’’ she told the crowd in French. ‘‘It was a very tough match today, but it’s good for me because, I don’t know, but it’s very good. I am exhausted.’’
Williams is the first American woman to reach the French Open semifinals since Jennifer Capriati in 2004. Her opponent Thursday will be 2012 runner-up Sara Errani, who advanced by beating No. 4 Agnieszka Radwanska, 6-4, 7-6 (8-6).
Williams is 5-0 against Errani.
In sunny, 65-degree weather on Court Suzanne Lenglen, Williams struggled with her first serve, hit five double-faults and was broken four times. She was indecisive with her shot selection and hesitant with her footwork, even as she built a lead in the first set, and for a long stretch she had trouble keeping the ball in the court.
The pivotal game came with Kuznetsova leading 2-love in the final set, when Williams held to reverse the momentum. She overcame three break points in the 16-point game, finally closing it with a forehand winner as Kuznetsova tumbled to the clay in vain pursuit.
Williams overcame yet another break point to hold and take the lead for good at 3-2. When she smacked a forehand winner to break again, she punctuated the shot with a pirouette and an upper cut, and she was soon accepting congratulations from Kuznetsova at the net.
Williams won despite committing 28 unforced errors, and she lost 20 of 32 points on her second serve. With the victory, she avenged a loss in the 2009 quarterfinals to the Russian, who went on to win the tournament that year.
Since losing in the first round a year ago at Roland Garros, Williams is 72-3, including titles at Wimbledon, the US Open, the London Olympics and the season-ending WTA Championships. She’s 21-0 this year on clay.