The 25-year-old shed sweat and blood before dethroning Federer 7-6 7-5 in a showdown that provided a memorable climax to an incredible men\'s season.
Since winning a fifth grand slam title at the Australian Open in a near six-hour epic against Rafa Nadal back in January, Djokovic\'s reign has come under attack from both Federer and Britain\'s Andy Murray, but after beating both in London he is clearly still the dominant force going into 2013.
World number two Federer has been all but unbeatable in the tournament since it switched to London in 2009 and was seeking a hat-trick of titles at the eye-catching Thames-side dome.
With the majority of the 17,000 crowd cheering for the Swiss maestro he forged healthy leads in both sets with some typical brilliance but was eventually stopped in his tracks by the Serb.
Djokovic, who had lost his last two meetings with the 17-times grand slam champion and trailed 16-12 in career meetings dating back to 2006, found himself 3-0 down after eight minutes and then faced a 5-3 deficit in the second.
Both times Djokovic dug deep, reeled in the Swiss stylist, then hammered him into submission to seal victory in two hours 14 minutes.
I\'ve experienced his aggressivity (sic) before, really trying to make his mark on the match, Djokovic told reporters.
I tried to convince myself that I will turn it around and fight. It happened again. I managed to deliver my best when I needed it most.
It was his first title at the ATP\'s blue riband event since 2008 in Shanghai and with it came the $1.76m jackpot for going through the elite tournament with a 100 percent record having won all his round-robin matches.
For 31-year-old Federer, who claimed his seventh Wimbledon title this year and temporarily dislodged Djokovic from the No.1 spot to break Pete Sampras\'s record of 286 weeks at the top of the rankings, there was frustration but few regrets.
You have to get over the finish line in the set and then obviously in the match, Federer, who also reached the Olympic singles final where he was beaten by Andy Murray, told reporters. He was better at that today.
It was great intensity, a good crowd. So it was fun playing. I think it\'s been a fantastic season to be part of.
Federer ended the season with 71 match wins, reaching 10 finals, while Djokovic out-stripped his stellar 2011, when he won three of the four grand slam titles, with his victory over Federer taking his tally to 75.
It was only the fourth time in the tournament\'s 43-year history that the world\'s top two players had contested the season\'s final and a fluctuating and unpredictable clash lived up to its pre-match billing.
Federer, seeking a record-extending seventh title, won the first nine points of the match on the way to a 3-0 lead.
The Swiss maestro, all smooth movement and silky racquet skills, could hardly believe his luck as nearly every ball Djokovic struck early on ended in the net or out.
It was not long before battle was joined, however.
Djokovic quickly wiped off the deficit to level at 3-3 and then served for the first set at 5-4 having broken Federer in a marathon ninth game of six deuces when forehand errors began to flow off the Swiss\'s racquet.
Djokovic failed to convert a set point though when his own forehand misfired and in the next game Federer drew blood, literally, when he had the Serb twisting and turning and finally landing in a painful heap on the blue-surfaced indoor court.
He needed treatment on a cut elbow at the changeover but returned to the fray to hold for 6-6 and then edged the tiebreak 8-6 despite Federer saving a second set point with an incredible reflex volley, raising the roof with chants of Roger Roger!
The second set followed a similar pattern.
Federer broke in the first game and this time held Djokovic at bay to reach 5-4, 40-15. The match looked set to go to the wire two poor points allowed Djokovic an escape route and he seized his chance with relish.
Two games later it was Djokovic serving for the match and he made no mistake.
A deflated Federer offered up a couple of mistakes to give Djokovic a match point.
The Swiss fought until the bitter end, running his opponent from side to side on match point but was powerless as Djokovic speared a stunning backhand past him.
A fitting shot to end a memorable season.