Novak Djokovic left Indian Wells with a $1 million check and his first trophy of the year, after beating Roger Federer 3-6, 6-3, 7-6 (3).
After Federer breezed to the first set in 31 minutes, Djokovic earned the lone break of the second set to go up 5-3 after Federer pulled a forehand wide.
I managed to stay mentally strong and have that self-belief, so that's something that definitely makes this title very special to me.
Federer rallied from a break down and a 5-3 deficit in the third set to force the tiebreaker, but he made a slew of mistakes to lose the 33rd meeting between the rivals.
Djokovic got the early break in the third, again on one of Federer's forehand errors, to lead 2-1.
His 112-mph (180 kph) ace gave him a 4-2 lead, and he extended it to 5-3 with a backhand winner down the line.
But Federer then served a love-game to make it 5-4 and broke Djokovic to tie the set, 5-all.
In the tiebreaker, however, the Serb raced to a 5-1 lead, helped by four errors from Federer, and closed it out when Federer's backhand landed in the net.
Novak Djokovic came into Indian Wells for the first time in four years without a title.
"Not winning a title and coming here, there were certain doubts," Djokovic said.
"I managed to stay mentally strong and have that self-belief, so that's something that definitely makes this title very special to me."
Djokovic will remain No. 2 in the world, while Federer will rise three spots to No. 5 in the ATP Tour rankings.
"I was able to just keep the pressure on Novak and show him that if he slips up, I will be there and I will make it a very competitive match in the end for him," Federer said.
Pennetta routs Radwanska
Flavia Pennetta routed injured Agnieszka Radwanska 6-2, 6-1 to win the women's title, the biggest of her career.
The Italian veteran's ranking plunged to 166th in the world in June, and she had struggled to rebuild her career after having right wrist surgery the previous August.
"After so many years, so much work and everything, this is the moment I always waited for,'' she said.
"And it's coming when you don't expect. It was something I was waiting since long time, and finally I have a good trophy in my hands.''
As the 20th seed, Pennetta became the lowest seed to win the title.
She came in ranked 21st and is projected to rise to No. 12 in the world Monday in the WTA Tour rankings. She beat top-seeded Li Na in the semifinals on her way to the title.