World number one Novak Djokovic recovered from a second-set battle to beat Roger Federer 6-3 6-7 (5-7) 6-2 in the BNP Paribas Open final.
The Serb had dominated the opening set at Indian Wells but the Swiss rallied in the second set, coming from a break down to win the tie-break.
Djokovic, 27, seemed rattled both by Federer and the crowd in the decider.
But he regained his composure to win his 50th career title and his fourth Indian Wells title.
"All the hard work I have done in the off-season has paid off," eight-time grand slam title-winner Djokovic told BBC Sport.
"Nothing has been handed to me. I had to earn this, to fight for it with all the commitment to my everyday routine with my team. Hopefully I can use this confidence for the rest of the season. It's a great start."
Djokovic came into the match full of confidence, having swept past Andy Murray in the semi-final, and he showed his intent with the first break-point opportunity in the fourth game of the match.
Federer rescued that situation but two games later, Djokovic went 40-0 up on the Swiss player's serve and although Federer saved the three break points, including with an ace at 30-40, Djokovic set up another chance and sealed it with an angled passing shot which Federer steered wide.
|BBC tennis correspondent Russell Fuller|
|"There was evidence here that even Djokovic gets tense. He served three double faults in the second set tiebreak, and then mangled a racquet after conceding his break of serve advantage in the deciding set.|
|The overwhelming majority of the crowd were pulling against him and yet, with the match in the balance, he still eased away from Federer by winning the final four games of the match.|
|His consistency and the standards he sets are currently out of reach."|
The Serb, who had won his two previous meetings against Federer at Indian Wells, held to love in the next game to go 5-2 up and quickly wrapped up the set when Federer netted.
Federer needed to try to impose himself more in the match in the second set and was given a glimmer of hope with a break point in the second game but Djokovic raised his game once again.
The Swiss threw everything at the Serb but the world number one, who won the Australian Open in January, gave it back to him and broke again in the third game.
After Djokovic held to go 4-2 ahead, the game seemed up for Federer but he held and then played some patient tennis to break his rival and level it at 4-4, much to the delight of the Indian Wells crowd.
The players could not be separated until the tie-break and although Djokovic led 3-1 and 5-3, he started to show signs of irritation with the crowd. His serve, which had been impeccable, also deserted him and he served two double faults to give Federer a way into the match.
|60%||1st serve %||58%|
|77%||1st serve win %||71%|
|52%||2nd serve win %||36%|
|Match time: 2hrs 17mins|
The match looked to have gone Djokovic's way when he went 2-0 up in the decider but his frustrations started to show again and he was broken and also demolished one of his rackets.
But that seemed to give him the impetus he needed and although Federer won the next game to level at 2-2, Djokovic rattled off the next four games to seal victory.
"I would like to congratulate Novak on a great final and a wonderful tournament," 17-time grand slam champion Federer told Sky Sports 3.
"It's a great start to the season and I hope we can play some more this year."