In a match fitting of a tournament final pitting the two highest-ranked players against each other, Djokovic rallied from early breaks in each set for a 7-6 (8-6), 7-5 win over Federer.
It was the second ATP Finals title for Djokovic, who also won the event in 2008 in Shanghai, and caps a year in which he'll finish No. 1 in the rankings for a second consecutive year. It was his 35th career ATP title and sixth this year.
Federer, who also won six times in 2012, saw his all-time finals record drop to 76-34. He had won the last two ATP Finals.
Federer started out Monday in control, quickly building a 3-0 lead that included a break at love but Djokovic got the break back midway through the set. Djokovic came out ahead of a marathon 18-point game with another break only to have Federer answer and tie the set at 5-5.
The tiebreaker was just as even before Djokovic finished off the final two points.
Federer took a 16-point game to open the second set with a break and held serve to get to two set points at 5-4, 40-15. But Djokovic took advantage when Federer had back-to-back errors and evened the set by getting the next two points.
He finished the year with a final break of Federer -- his fourth of the day -- getting the final point with a backhand winner.
Each player won 58 percent of the points on serve with Djokovic winning one more -- 96-95 -- point over the duration of the 2-hour, 14-minute match.