World number one Djokovic won 7-6 (7/1), 6-7 (10/12), 6-4, 6-3 adding the Wimbledon title to the Australian Open he captured in January.
It was a cathartic moment for Djokovic just a month after his heartbreaking French Open final defeat against Stan Wawrinka – a loss that denied him the only major title he has yet to win.
For 33-year-old Federer, it was a bitter end to his bid to become the oldest Wimbledon champion of the Open Era.
The 17-time major winner has now gone three years since his last Grand Slam triumph.
But he had his chances.
In a rollercoaster rematch of last year's final, he was 4-2 up in the first set and had two set points.
Federer then had to save seven set points in the second set before bravely levelling the contest.
However, Djokovic, five years Federer's junior, stepped on the gas and raced away to the title.
Sunday's final was the pair's 40th career meeting and 12th in the Grand Slams.
Djokovic was playing in his 17th major final compared to Federer's 26th.
But despite Federer's majestic triumph over Andy Murray in the semi-finals, which suggested he was not ready for the retirement home just yet, Sunday's reality check looks certain to leave the Swiss thwarted in his quest to add to his record 17 Grand Slam title collection.
In front of a Royal Box crammed with tennis and Hollywood A-listers,
including Bjorn Borg, Rod Laver, Benedict Cumberbatch, Hugh Grant and Bradley Cooper, Federer was in the early ascendancy.
He broke for a 4-2 lead but Djokovic hit straight back condemning the Swiss to just his second lost service game in 94 served up at the tournament.
Federer then saw two set points disappear in the 12th game, both saved courtesy of back-to-back 120mph serves.
Djokovic capitalised on his escape, racing through the tiebreaker with six consecutive points to claim the opener when Federer served up a double fault.
The Serb committed just three unforced errors in the first set, a key statistic in what would always be a tight encounter.
By contrast, Federer hit 11, the same as he suffered throughout his semi-final win over Murray.
Federer wasted two break points in the fifth and 11th games of the second set having saved a first set point in the 10th.
That paved the way for a titanic tiebreak where the 33-year-old saved six more set points before levelling the final on his second set point.
At 12/10, it was the longest tiebreak in a Wimbledon final since 2000 when Pat Rafter faced Pete Sampras with the set taking 65 gripping minutes to complete.
To his credit, Djokovic swiftly recovered, breaking for a 2-1 lead in the third set which became 3-2 when rain forced them off for 20 minutes.
The world number one confidently wrapped up the set 6-4 with just two unforced errors even if the brief stoppage had dampened the fireworks of the second set.
Djokovic was strangling the life out of Federer's game and another break gave him a 3-2 lead in the fourth set.
The title was his on the stroke of the third hour with a sweeping forehand into an open court.
As has become the Serb's tradition, he celebrated by pulling out a piece of Centre Court grass and eating it.