PARIS (AP) - What started as a replay of a U.S. Open nightmare turned into something much better for Roger Federer: a trip to the French Open semifinals.

Federer overcame a two-set deficit for the seventh time in his career Tuesday to defeat Juan Martin del Potro 3-6, 6-7 (4), 6-2, 6-0, 6-3. It was Del Potro who famously beat Federer at the Flushing Meadows final in 2009 when the Swiss star was on top of the tennis world.

Third-seeded Federer reached his record-tying 31st Grand Slam semifinal, where he'll play Novak Djokovic or Jo-Wilfried Tsonga.

Ninth-seeded Del Potro said he'd need a nearly perfect day to reprise his upset over Federer from 2009, and for two sets he did it. But Federer rallied and won his 237th Grand Slam match.