“It was quite unreal to come back form two match points down … and it was strange to play a tiebreaker at 12-all.
Djokovic’s five Wimbledon titles puts him level with Bjorn Borg in the record books.
“When I was 3-4 years old, I would dream of being a player. This was always the tournament I wanted to win.
“I would make little trophies out of things in my room, imagining being here.. This has always been the tournament for me.”
Federer was competing in his 12th final here and now stands 22-26 against Djokovic in their career series.
Federer, who put out Nadal in the semis, has never defeated both Nadal and Djokovic in the same Grand Slam tournament; he and the Serb were facing off for the 16th time at a Grand Slam, and their third here.
Victory by Djkokovic, 32, extends the streak of Grand Slam titles won by players aged 30 or older to 12 in a row.
The last player aged younger than 30 to win a major title was Andy Murray (29 years 56 days) at 2016.
Djokovic took the early lead in an opening set which went into a tiebreaker, with Federer fighting from 3-5 down in the decider but failing to finish off the comeback to drop the opener after almost an hours.
But the roles were reversed in a lightning 25-minutes second set, with the Swiss second seed blitzing through to level at a set apiece as Djokovic donated a double fault on set point and managed a mere two winners.
The unpredictability continued in the third set.
Federer missed on a set point in the 10th game with Djokovic holding for 5-all. As the set went to another tiebreaker, the Serb sprinted to 5-1, with Federer unable to fully close the gap.
The Swiss floated a return wide for two set point to Djokovic, with only one required as the top set took a 2-1 lead on sets.
But in the fourth, Federer turned the tables once again, running off two breaks of serve but facing a break point for the first time after two hours, 47 minutes of play.
He saved it by winning a spectacular 35-shot rally only to fall, but dropped the game for 5-3.
Federer finished off the set and took it into a deciding fifth set with a winner on the first of three set points.