Having weathered an early storm to win the first set, the 30-year-old, looked to have victory in his grasp when he served for the match at 5-4 in the second. But back came Tsonga, levelling and then fighting from 5-2 down in the tie-break to level, only for his opponent to clinch the crucial break in the decider.
Federer, who also becomes the tournament's oldest winner, previously held the record jointly with Pete Sampras and Ivan Lendl, while his 70th victory in his 100th final, netted the Swiss more than £1million. Federer, who will take a winning streak of 17 matches into next season, said: "I couldn't be more happy and I couldn't be more exhausted."
Tsonga piled on the pressure early in the first set, but crucially the break did not come and in the eighth game Federer made his move, winding up his backhand to earn three break points and taking the second when his opponent netted an attempted drop volley
That left the fourth seed serving for the set and, although Tsonga saved two set points in impressive fashion, there was nothing he could do on the third.
The frustrated Frenchman then had to dig himself out of a hole when he began the third game of the second with two double faults, but dig he did, two aces on break points neatly rescuing the situation. The tables had well and truly turned, though, and Federer did clinch the break two games later with a thumping forehand return.
Tsonga was hanging on by his fingernails but he was determined not to make it easy and he fought off another break point in the seventh game with a brave drop shot. And that became very significant as Tsonga made a last-ditch attempt with Federer serving for the match, using his power brilliantly to bring up his first three break points and taking the third.
Tsonga continued to live dangerously on his serve but hung on as into the tie-break they went. Having worked so hard to earn his chance, Tsonga gave away a cheap couple of points and at 5-2 he was staring down the barrel once more. Again he clawed back to level before an ace earned Federer his first match point, but Tsonga powered away a forehand winner.
Another service winner gave him a set point and he took it with a stunning forehand return. It was no more than the world number six deserved and Federer, who has made a bit of habit this season of snatching defeat from the jaws of victory, had to refocus quickly.
He did not panic, though, and in the eighth game of the decider his chance arrived. Twice Tsonga saved break points but a third arrived and this time he dumped a forehand wide. And there were to be no more heroics, Federer sealing victory with an easy forehand volley to add to the titles he won in 2003, 2004, 2006, 2007 and 2010.