The second-seeded Argentine bested Federer 6-4, 6-7 (5-7), 7-6 (7-3), denying the Swiss superstar a sixth title in Basel.
Del Potro managed only one service break in the 3-hour match, but it was enough to hand him his second victory in two weeks, He triumphed in last week's Vienna tournament.
It was his fourth crown overall this year, following victories in Marseille and Estoril, and broke a seven-match losing streak to the world No. 1.
Federer was appearing in his seventh straight Swiss Indoors final and lost for just the second time in his last 35 matches there.
Beautician charged with giving client fatal silicone butt injection
Ohio bar shooting arrested, charged with murder