Despite playing some brilliant tennis himself, Federer was unable to get the better of Djokovic, who ended up winning the match 6-3, 6-7 (5), 6-2.
After Djokovic won the first set 6-3, Federer came roaring back in the second to set up a tie-break, which he won.
But, things started to go awry for Federer in the third set and Djokovic came to the fore to claim his fourth BNP Paribas Open title.
"I started to play a bit better as the match went on," Federer, who was looking to win his fifth Indian Wells crown, said after the match.
"I think it was definitely my best spell midway through the second to mid third set. But I'm disappointed clearly not to go up 3-2 and then see what happens from then, because it was a tough game to break in the third to come back on serve at 2-1. So it was disappointing to let it slip away, and next thing you know the match is over.
"For me it was totally against the way the match was going. It was actually the comeback for me to really snap my authority on the match. He loosened up and tried to play a bit more aggressive and that worked. He did very well at that. After that he never looked back and he loosened up a bit.
"Novak did well to obviously sustain the lead for most of the match; I think he found an extra gear in the end. It was tough. I enjoyed the match; it had a bit of everything. It was from my side a bit more up and down, and he was just more solid. That's why he totally deserved to win today, in my opinion."