(CNN) -- Novak Djokovic upset Roger Federer in the final of the Swiss Indoors tournament on Sunday to end the world No. 1's bid for a fourth successive title at his home event.
The world No. 3 won 6-4 4-6 6-2 to claim his fourth success of the season, and his first indoors since winning the season-ending ATP Tour finale at the end of last year.
Their fifth meeting of the year went with serve until the ninth game, when the Serbian broke Federer and then saved four break points before converting his sixth set-point in a 20-minute 10th game.
He broke the Swiss again in the opening game of the second set, but Federer hit back to level at 2-2 and then leveled the overall score after Djokovic served his sixth double-fault of the match to trail 15-40 in the 10th game.
Second seed Djokovic responded in emphatic style as he took a commanding 4-0 lead, then won five points in a row to go 5-1 up before ending his opponent's 19-match winning streak at the tournament.
He became the fifth player this year to win a title after saving match-points during the tournament, having rescued three in Saturday's semifinal win against Radek Stepanek in Basel.
Federer has now lost three of his seven finals this year, including the U.S. Open, but has still won two Grand Slam events in the French Open and Wimbledon.
Meanwhile, world No. 4 Andy Murray continued his solid comeback from a wrist injury to win the Valencia Open on Sunday.
The British top seed had been out for six weeks, but defeated Russia's Mikhail Youzhny 6-3 6-2 in the final in Spain on Sunday to claim his sixth title this year -- his best effort in a season.
It also boosts his hopes of a strong showing at the season-ending ATP World Tour finals in London later this month.
World No. 23 Youzhny had been in good form after reaching the final in Tokyo and winning in Moscow, but found himself 5-1 down in the first set after conceding two breaks of serve.
He was soon 3-0 down in the second set after two more breaks from Murray, and could not take either of two chances to break back in the next game.
Also on Sunday, American James Blake ended the career of veteran Frenchman Fabrice Santoro with a 6-4 6-3 win in the first round of the Paris Masters.
The 36-year-old wildcard entry took a lap of applause from the crowd to mark his retirement.
Blake's reward is a second-round clash with Murray.