Djokovic, seeded 12th, won 6-2 6-2 7-6 (7-3) to claim a 13th Slam – his first major since the 2016 French Open.
The Serb, 31, quickly took control to win the opening set in 29 minutes, breaking twice more in the second set.
Djokovic saw off five set points in an even third set before dominating the tie-break to seal victory. He dropped to his haunches just inside the baseline as Centre Court rose to acclaim the champion, hugging South African Anderson at the net before skipping over towards his box and celebrating wildly in front of his coaching team and wife Jelena.
“I had many moments of doubt, I didn’t know if I could come back to this level to compete,” said Djokovic, who also won the Wimbledon title in 2011, 2014 and 2015.
“There is no better place to make a comeback, it’s a sacred place for the world of tennis, it’s very special.”
He is now in outright fourth place on the all-time list of Grand Slam men’s singles titles, moving clear of Roy Emerson and closing the gap on Roger Federer (20), Rafael Nadal (17) and Pete Sampras (14).
The former world number one will move back into the top 10 when the latest rankings are released on Monday.
In the women’s singles final played earlier on Saturday, Angelique Kerber became only the third player to defeat Serena Williams in a Wimbledon final, winning her third major title, winning 6-3, 6-3.
The German is now the fourth active player to own more than two Grand Slam titles. Also, Kerber becomes the first German -man or woman – since Steffi Graf to win the Wimbledon singles. The last German woman to win the Wimbledon was Steffi Graf in 1996, while Michael Stich won the men’s singles in 1991.
Serena tweeted, “I was really happy to get this far. For all the moms out there, I was playing for you today” Grace, poise and emotion. The runner-up reacted.