Anderson repeated Lewis' feat of successfully defending his first World Championship title, becoming only the fourth player in history to do so, as the pair shared an incredible 34 180s - breaking the record for the most maximums in a professional match.
The duo fought out a high-quality affair and could hardly be separated for most of the match, with no player leading by more than a single set until the eighth set before Anderson went on to seal a 7-5 victory.
The win was sealed in style as Anderson added a magnificent 170 checkout in the penultimate leg of the battle, which he then won by landing double 12 - the same double that saw him wrap up the epic 2015 final against Phil Taylor.
"The way I've played in the tournament, I think I've deserved this," said Anderson, who collected Ł300,000 to add to the Ł15,000 nine-dart bonus he had won for his perfect leg in his semi-final win against Jelle Klaasen 24-hours earlier.
"It never really clicked but there was some great darts. I can't remember the 170 checkout but if you're going for it you need the leg so it was important.
"It's great to have defended the title. It feels fantastic and I did it at probably 85 percent of my best game.
"I've got the trophy for another 12 months at least. It would be lovely to make it a hat-trick next year and do something really special but I'm not getting any younger. I'll keep plodding on and see what happens."
Lewis was denied a third World Championship crown, having first won the title against Anderson in 2011 before defending it the following year.
"I thought it would go all the way until he took out the 170," said Lewis, who averaged over 100 and rattled in 19 180s as he tasted defeat in a World Championship final for the first time.
"I've been practicing hard for the last two or three months and it's helped me improve towards the end of this year. Let's see how good I can be next year - I've started stepping up my game again.
"Michael van Gerwen has been the best player in the last year and Gary has been the best in this tournament but I'm not too far away.
"I don't think either of us really played our very best darts but I was playing really well towards the end and when he took that 170 out it probably just finished me off.
"Fair play to him, it is a great achievement. Even though I'm disappointed, it has been a successful tournament for me.
"I'm back up to number three in the world rankings and this has really kick-started my year."
Lewis took the first set 3-1 as the defending champion struggled to get going but Anderson levelled by taking three straight legs in set two, including two brilliant 11-darters.
Anderson took the third set 3-1 but Lewis grabbed a break of throw with a sweet 77 checkout in the deciding leg to square up the match at two sets apiece.
A fabulous 131 checkout helped Lewis edge the fifth set as he wrestled back the lead but a brilliant 86 finish on the bull saw Anderson clinch the sixth set 3-1.
The Scotsman then moved back ahead, taking set seven in four legs and he then took three straight legs to wrap up the eighth set, moving two sets clear for the first time in the match.
Lewis responded by winning three consecutive legs to pull back within a set of his opponent as he capped off set nine with a fabulous 121 checkout, but Anderson then took three more legs without reply as he clinched the tenth set with a 108 checkout to move within a set of retaining his title.
Lewis again reduced the deficit as a fourth straight set was won by a margin of three legs and he looked on course to set up a deciding set when he broke Anderson's throw in the first leg of the twelfth set.
The reigning champion refused to surrender his trophy though, and broke back immediately before taking out his magical 170.
He then went on to seal a sweet second World Championship glory by landing double 12.
In addition to the record breaking number of maximums in the final, there were also more 180s hit throughout the 2016 World Championship than any previous staging of the tournament.
The sport's showpiece event saw 654 maximums landed, eclipsing the 625 180s that were hit in the 2015 tournament.
William Hill World Darts Championship
Adrian Lewis 5-7 Gary Anderson
Best of 13 sets
Adrian Lewis 5-7 Gary Anderson
SET ONE: 3-1
Lewis landed double eight to take the final's first leg but Anderson pinned double ten to level after his opponent had missed three darts to break. Lewis finished 40 in each of the next two legs to seal the first set.
SET TWO: 0-3
Anderson landed his first 180 and completed an 11-darter with an 81 finish. He then took out 60 to break and fired in another 11-dart leg, finishing on 41 to level the final.
SET THREE: 1-3
Lewis scored a 180 and pinned double eight but Anderson landed double top, double ten and double six to take the set and the lead in the match.
SET FOUR: 3-2
Anderson defied Lewis' fourth 180, which was a World Championship record 626th maximum in the tournament, by taking out 121 - but he miscounted his finish in the following leg, allowing Lewis to peg double eight. Anderson bedded double 18 but Lewis levelled on double 16 before grabbing a crucial break of throw with a 77 finish.
SET FIVE: 3-2
Anderson's third maximum helped him go ahead but Lewis levelled with a sublime 131 finish. The pair then exchanged 180s before Lewis pinned double ten and they both started the fourth leg with maximums as Anderson landed double 18 to force a decider. Lewis kicked in with his seventh 180 and eventually nailed double five to wrestle back the lead in the match.
SET SIX: 1-3
Lewis hit back-to-back 180s on the way to completing an 11-darter to break with an 83 finish. Anderson broke straight back on double five before bedding tops and pinning the bull for an 86 checkout as the match became tied once again.
SET SEVEN: 1-3
Anderson pegged double seven to go ahead with a break of throw but Lewis took out 81 to reply in kind. Both players hit 180s in the following leg, which Anderson won on double six for a third straight break. When Lewis missed two darts to save the set, Anderson landed double ten to go back ahead.
SET EIGHT: 0-3
Anderson reeled off three straight legs despite Lewis hitting his 12th and 13th 180s as the defending champion moved two sets ahead for the first time in the match.
SET NINE: 3-0
Lewis finished 76, 20 and a brilliant 121 to win the ninth set in three legs, moving back within one of his opponent.
SET TEN: 0-3
Anderson finished 86 and then pinned double 12 to break before a brilliant 108 checkout moved the world number two within one set of victory.
SET ELEVEN: 3-0
A fourth straight set was won 3-0 as Lewis pulled back within a set of Anderson, upping his 180 tally to 16 and producing clinical finishes of 81 and 74.
SET TWELVE: 1-3
Lewis hit his 17th and 18th 180 as he broke Anderson's throw on double 16. Lewis 19th maximum was in vain, though as Anderson broke back with a neat 64 checkout. He then produced a sensational 170 checkout before landing double 12 - the same double that won him his first World Championship title a year ago - to complete his incredible defence of the Sid Waddell Trophy.