The 27-year-old world number one from Serbia also captured his fourth Indian Wells crown and is now tied with world number two Federer for the most men's titles in the California desert.
"The trophy is very heavy," Djokovic told the crowd as he celebrated adding to the titles he won in 2008 and 2011 as well as last year.
Djokovic had lost his last two matches to Federer in straight sets after beating him in last year's Wimbledon final. The five-time Australian Open winner also needed three sets to beat Federer in the 2014 Indian Wells title match.
"If you look at the big picture, I thought I deserved it, because I really fought for it," said Djokovic. "I’m at the prime of my career. I’m going to use every part of this fact to stay where I am and to fight for as many major titles as possible.”
Even though he had the crowd on his side, Federer couldn't overcome his poor serving and 43 unforced errors. "Novak did well to sustain the lead for most of the match," said Federer. "I think he found an extra gear in the end."
Halep downs Jankovic in biggest title win
Halep claimed the biggest title of her career on Sunday, lifting the Indian Wells WTA trophy with a 2-6, 7-5, 6-4 victory over former champion Jelena Jankovic.
The hard-fought triumph over the former world number one from Serbia made Romania's 23-year-old Halep the first player to win three WTA titles this year.
"I don't know how I won today because I didn't play my best," said Halep. "But I just wanted to fight till the end. I'm really happy that I have another title."
Like Sports on Facebook, follow @ETribuneSports on Twitter to stay informed and join in the conversation.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ