Novak Djokovic has prevented Roger Federer from making it four in a row at the Swiss Indoors tournament in Basel, taking the top seed's hometown title 6-4, 4-6, 6-2.
Number three seed Djokovic saved five break points in a game lasting 24 minutes to clinch the dramatic first set.
"It was maybe the turning point in the whole match," Djokovic said afterwards. "I was fortunate to keep my nerves."
World number one Federer, who was once a ballboy at the tournament, fought back from a break down to win the second set and rouse his fans in the packed St. Jakobshalle.
But Djokovic raced to a 4-0 lead in the decider, and closed out victory after Federer had wasted three break points in the sixth game.
"I still won some chances for myself after that [Djokovic's 4-0 lead]. But Novak played through confidently, he won here today deservedly," Federer said in a television interview after the match.
Federer is now 59-9 this year after losing only his third match since May.
The result brings the 22-year-old Serb to a 3-2 record this year against Federer. Djokovic is now celebrating his fourth title this season after Dubai, Belgrade and Beijing.
But it was not an easy road for Djokovic to get to the €1.75 million ($2.58 million) Swiss Indoors final.
In the quarterfinal on Friday against Swiss player Stanislas Wawrinka he was one set and a break down. In Saturday's semifinal he had to fight off three match balls in a row against Radek Stepanek.
Federer had not lost serve in the four matches leading to the final although Djokovic was his first seeded opponent. Ivan Ljubicic of Croatia was the last man to beat Federer at his home event, in 2003.
The director of Swiss Indoors, Roger Brennwald, rated the Federer-Djokovic final as "the most beautiful [in Basel] since the confrontation between Björn Borg and Ivan Lendl in 1980".
Brennwald was also delighted with the performance of the other Basel native, Marco Chiudinelli, who lost to Federer in the semifinals on Saturday.
"Marco came back from nowhere after the injuries he sustained. He proves that in sport one should never give up."
swissinfo.ch and agencies
The Davidoff Swiss Indoors is the largest sporting event in the country with a budget of SFr18 million, 900 paid staff and 71,600 spectators.
Next year the Basel event will celebrate its 40th anniversary and its director Roger Brennwald said the Indoors will be even bigger in 2010.
The Swiss Indoors got a boost in stature this year with its promotion to the ranks of the ATP 500.