Victory allowed the top seeded Serb, who was also the 2011 champion and runner-up last year, to end a run of three successive defeats in Grand Slam finals but the 27-year-old struggled to get across the finish line, surrendering a 5-2 lead in the fourth set and then a match point. (Agencies)
Djokovic celebrated victory in typically eccentric style, kneeling on the Centre Court turf and munching on a few blades of grass just as he had done three years ago.
Defeat for 32-year-old Federer, who won the most recent of his 17 Grand Slam titles at the All England Club in 2012, ended his bid to become the oldest Wimbledon champion in the Open Era and of breaking the tie of seven titles he shares with Pete Sampras.
"First of all I want to congratulate Roger it was a great match to be a part of he is a magnificent champion and a great example of a great athlete and a role model. I respect everything you have done and thanks for letting me win today," smiled Djokovic.
"That's why he has 17 Grand Slams because at important times he comes up with those shots. After losing the fourth set it wasn't easy to go on and win the fifth set, I don't know how I did it," said Djokovic.
Djokovic has the added bonus of reclaiming the world number one spot from Rafael Nadal.
Federer said he was surprised to have got to a deciding set.
"It was a great final. I can't believe I made it to five, it wasn't looking good for a while," said Federer.
"Going into a match with Novak, you know it's going to be tough. I can only say congratulations to him. It was an amazing match and an amazing tournament. It's well-deserved," said Federer.
In front of a Royal Box containing Prince William and wife Catherine, the opening set was a fascinating contrast between Federer's mix and match of serve and volley and Djokovic's renowned baseline flair in the pair's 35th meeting.
Two rallies featured 21 strokes apiece but neither player could fashion a break point.
Victory allowed the top seeded Serb, who was also the 2011 champion and runner-up last year, to end a run of three successive defeats in Grand Slam finals but the 27-year-old struggled to get across the finish line, surrendering a 5-2 lead in the fourth set and then a match point.