The Swiss third seed's chances of winning a second title here appeared to be sinking fast as he drowned under a hail of winners flying off Del Potro's racket in the opening two sets.
But the 2009 champion stayed calm to break for a 2-0 lead in the third set and from then on Del Potro's dodgy left knee and mindset started to let him down.
The ninth seed won only eight points during a forgettable fourth set and his misery was compounded when he bowed out after a forehand clipped the net and bounced out to hand Federer victory.
The Swiss star claimed that playing on the slower Suzanne Lenglen court made it harder for him.
"That makes it hard for a lot of variation. You don't get any free points on the serve," he said.
"Anything that's maybe short rallies and chips and down the line shots, it's a better match for me. He obviously like to go back into backhand and then rip the forehand once he gets the chance. I thought it was very good conditions for him. I knew it was going to be tough anyway.
"But I was happy that the first two sets took some time, because I did favor myself once the match got longer. That's kind of how it came. So I'm very happy with the way I fought and started in the third set, fourth set, and even in the fifth set where obviously it was the toughest, because that was his last chance and his resistance maybe was the biggest there."
Del Potro, meanwhile, was left to rue his missed opportunity to claim Federer's scalp.
"He start to play much better than in the beginning of the match and I feel his ball more in the baseline," Del Potro said. "He put me to run a lot in the third and fourth set. He made better match than me after the second set.
"I didn't have any chance to win until the first game in the fifth set when I had break point. He play well I served really bad in the fourth set, also. And if I serve bad against Federer or the top guys, you don't have too many chance to win points.
"He was playing with more confidence the fifth set than me. When he had the chance to close the match, he made it. "
Federer, looking for a record 17th grand slam crown, next faces Novak Djokovic or Jo-Wilfried Tsonga for a place in Sunday's final.