He left with a $1 million check and his first trophy of the year, beating Roger Federer 3-6, 6-3, 7-6 (3) on Sunday to win the BNP Paribas Open for the third time.
"Not winning a title and coming here, there were certain doubts," Djokovic said. "I had ups and downs in my concentration in opening rounds, but I managed to stay mentally strong and have that self-belief. 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.
Federer still leads the series 17-16, having beaten Djokovic in three sets in the semifinals at Dubai two weeks ago. Djokovic will remain No. 2 in the world, while Federer will rise three spots to No. 5 on Monday in the ATP Tour rankings.
Flavia Pennetta routed injured Agnieszka Radwanska 6-2, 6-1 to win the women's title, the biggest of her career.
Federer was trying to win a record fifth title in the desert, and at 32, he would have been the oldest Masters 1000 winner since 34-year-old Andre Agassi won at Cincinnati in 2004.
But Djokovic wouldn't allow it.
After Federer breezed to the first set in 31 minutes, Djokovic settled down and locked into the punishing rallies that marked most of the match.
"I know he always comes out confident, aggressive," Djokovic said. "He doesn't give you the victory; you have to earn it."
Djokovic got the early break in the third, again on one of Federer's forehand errors, to lead 2-1. His 112-mph ace gave him a 4-2 lead, and he extended it to 5-3 with a backhand winner down the line.
Federer served a love-game to trail 5-4. Djokovic served for the match in the next game, but his forehand error allowed Federer to tie it up, 5-all.
"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.
Federer held at love again and Djokovic gave up just one point on his serve for a 6-all tie.
"I made my presence after that," Djokovic said. "I stepped closer to the line, and made him play an extra shot always and changing the pace of the ball. It paid off."
The Serb raced to a 5-1 lead in the tiebreaker, helped by four errors from Federer. Another of Federer's forehand errors gave Djokovic a 6-2 lead before the Swiss star's ace ensured Djokovic would have to win the match on his serve.
"At the end, he made sure he kept the ball in play and I might have made a few too many errors when it really mattered," Federer said.
Djokovic's victory evened their rivalry on hard courts at 13 wins apiece. The Serb won his other Indian Wells titles in 2008 and 2011.
A year ago, Pennetta was close to retiring from tennis.
Her 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.
Now she's glad she stuck around.
"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.
Actually, the crystal trophy was so heavy, she didn't hoist it for photographers.
The 32-year-old Italian became the third-oldest winner of the desert tournament after Martina Navratilova, who won at age 33 and again at 34 in 1990-91. It was Pennetta's first title since winning at Marbella in 2010.
"We are old, but we still good athletes," Pennetta said. "We are strong. We have so many years on the tour, and we know how to handle the emotion and everything."
As the 20th seed, Pennetta became the lowest 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 winning the title worth $1 million.
Radwanska, seeded second, was bothered with a left knee injury during the final. She twice called for the trainer in the second set and had her knee heavily taped. She was in tears apologizing to the sympathetic crowd afterward, saying she was unable to run.
Pennetta threatened from the first game of the match, when she held two break points and had one more in the third game. She finally converted in the fifth game on Radwanska's errant backhand, then broke again in the seventh game on the Pole's forehand error. Pennetta won the final five games to wrap up the first set, 6-2.
Radwanska held for a 1-0 lead in the second before she got the trainer on court and Pennetta called for her coach. Pennetta staved off a break point to hold at 1-1, the last challenge Radwanska offered before it became evident she wasn't herself. She said she hurt her knee a few days ago in practice.