Murray, the second seed, broke top seed Djokovic twice in the first set on a baking Centre Court and held serve to love to clinch it in exactly an hour.
Djokovic regrouped quickly, however, and led 4-1 in the second set before Murray roared back, breaking the rattled top seed twice to take it 7-5.
Murray led 2-0 in the third set with Djokovic looking beaten but the Serb hit back to win the next four games.
Murray responded to break serve twice and served for the match at 5-4.
He led 40-0 but Djokovic saved all three championship points before Murray clinched victory at the fourth attempt after three hours nine minutes when the Serbian netted a backhand, sparking wild celebrations around the court.
"That was one of the toughest moments, today was unbelievably tough match," Murray said in a courtside interview after lifting the trophy.
"I don't know how I came through the final three points, I'm so glad to do it.
"I have played Novak many times and when everyone finishes playing, he will go down as one of the fighters," the Scot added.
"He did the same today and that is what made it tough. I understand how much everyone wanted to see British winner at Wimbledon and I hope everyone enjoyed it."
Djokovic was gracious in defeat.
"Congratulations to Andy you absolutely deserved it, you played incredibly," the six-times grand slam champion said.
"I know what it means to you guys in the whole country so well done. It is a great achievement. I gave it my all and it was an honor to be in this match, in this final."
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO Sports and on Facebook at AhramOnlineSports)