Updated

Juan Martin del Potro denied hometown favorite Roger Federer a sixth Basel crown with a thrilling 6-4, 6-7 (5-7), 7-6 (7-3) win.

The second-seeded del Potro recorded the only break of serve in a match that lasted nearly three hours and captured his second title in a row following a triumph in Vienna last week. He also won tournaments in Marseille and Estoril earlier this year.

"I was fighting all the time. I got lucky in the end, but I felt that I played a really good match," del Potro said.

Sunday's victory upped the Argentine's career record in finals to 13-5 and ended a seven-match losing streak to Federer, who appeared in his seventh straight Swiss Indoors final and ninth overall.

"I thought overall I played pretty good," Federer said. "He got off to a bit of a better start, but it was close. He served well at the beginning, which made him the better player in the first set. The second set was close. He didn't play a very good tiebreak and then I had my chances early on in the third. I couldn't break, despite doing the right things, but then I didn't play a good tiebreak myself."

The world No. 1 Federer lost for just the second time in his last 35 matches at his hometown tournament. His only other setback during that stretch came in the 2009 final to Novak Djokovic.

Federer won this event from 2006-08 and again the previous two years.