The 25-year-old, who was competing in his fifth Grand Slam final, overcame the world number two in five sets at Arthur Ashe Stadium.
Murray made the perfect start to the match, breaking his opponent to love in the opening game.
Djokovic broke back immediately and, although Murray edged ahead again with a second break in game five, the Serb capitalised on a nervy service game to force an opening-set tie-break.
After failing to convert five sets points, Murray succeeded at the sixth time of asking to take the breaker 12-10.
With the momentum in his favour, he then stormed into a 4-0 lead in the second, but Djokovic battled back to level at 5-5.
The Scot quickly regained his composure. After holding to 30, he broke Djokovic for a fifth time to clinch the second 7-5 on set point number two, when his opponent fired wide with a slack forehand.
Murray saved two break points to hold onto his serve at the start of the third set. However, Djokovic was looking the fresher of the two competitors at this stage and was ruthless in the Scot's next service game, breaking to 15.
Djokovic broke again to take the set 6-2 and then continued his dominant streak by racing into a 2-0 lead in the fourth.
Despite a titanic effort from Murray to get back on terms, Djokovic sealed the set 6-3 to ensure that the match would go the distance.
With every point being contested like it was a matter of life or death, Murray somehow managed to win the opening three games of the decider to move ahead by a double-break.
Djokovic reduced his deficit to 2-3, before Murray held to love for the first time since midway through set two.
The Scot then delivered the decisive blow by breaking to 15 for a 5-2 lead.
Murray was forced to wait as he prepared to serve for the championship, while Djokovic received treatment from the trainer.
The British number one held his nerve though, holding to 15 to earn a much-deserved place in the record books.
Murray is the first British player to win a Grand Slam since Fred Perry, who triumphed in New York 76 years ago.