Top seed Juan Martin Del Potro retained his Swiss Indoors title with a 7-6 (7-3) 2-6 6-4 victory against home favourite Roger Federer in Basel.
A sixth Swiss title for world number six Federer would have sealed his place at next month's ATP World Tour Finals in London for a 12th successive year.
But Del Potro, who beat Federer in last year's final, won an opening tie-break.
Federer levelled but was immediately broken in the decider as Del Potro triumphed in two hours 20 minutes.
Federer, who has won only one title in 2013, produced some vintage moments but could not deny Del Potro his fourth ATP Tour 500 title in a calendar year.
The Swiss now has to beat Kevin Anderson or Mikhail Youzhny in his second-round match at the final qualifying event in Paris next week to ensure one of the eight places at the 02 Arena for the World Tour Finals, which would equal Ivan Lendl for the most successive appearances at the season finale.
Del Potro, already safely through to the Tour Finals, broke in the eighth game of the opening set but to the delight of the crowd Federer broke back immediately to love.
The home favourite saved two break points to take the set to a tie-break but quickly found himself 3-0 down and Del Potro went on to take the set.
A majestic cross court winner sealed a break early in the second, however, and Federer swiftly claimed the set in 36 minutes.
But having saved one break point with an overhead volley at full stretch, Federer lost his serve in the opening game of the decider with a double fault.
He had two break points in the next but was unable to take them, and had to stave off a break point opportunity for Del Potro in the seventh game before the world number five comfortably served out for his third successive victory against the 17-time Grand Slam winner.