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.