despite heavy rain forcing a three-hour delay and an evening start.
He forced five-time champion Federer, playing in his first US Open final in six years, to save three break points in a six-minute opening game.
The top seed held to love and then broke for 2-1 —- it was just the third time in 84 service games at the tournament that the Swiss veteran had been broken.
However, with the playing surface still damp from the hours of rain, the Serb suffered a worrying fall in the next game, turning over on his right ankle and bloodying his elbow.
Federer pounced to retrieve the break but the Serb was soon back in the ascendancy and Federer was broken again in the seventh game.
Federer saved a set point in the ninth, but conceded the first set with a netted backhand in the 10th game.
It ended his run of 28 consecutive sets won, a mark stretching back to July’s Wimbledon championship match, where he lost to Djokovic.
Djokovic saved five break points in an eight-minute game to go 1-1 in the second set despite Federer’s first use of his ‘SABR’ charge-and-chip ploy.
Federer then had two set points in the 10th game — surrendering one with a wild forehand with an open court at his mercy.
Djokovic held after seven deuces and 15 minutes of unbearable tension as he faced down Federer and the majority of the crowd.
The Swiss allowed another set point to slip away in the 12th game but he converted his fourth on a monster backhand to level the final.
The stadium erupted, leaving no doubt whatsoever as to the crowd’s affections.
Djokovic broke for 2-1 in the third, but unsettled by a call from the crowd during his service action he handed back the break for 2-2.
The top seed saved two break points in the eighth game before Federer suddenly lost focus and out of nowhere handed Djokovic a 5-4 lead.
Federer had two break points as he desperately clung on but Djokovic held his nerve to serve it out.
Djokovic sensed blood and broke in the opening game of the fourth set and saved a break point to lead 4-2.
The Serb broke again for 5-2, roaring at the crowd and the New York nighttime sky.
But there was still time for a twist as Federer retrieved one of the breaks when Djokovic served for the title and backed it up with a hold.
The Swiss let three more break points slip away in the 10th game before nerveless Djokovic sealed victory off a long Federer service return.