Higgins had been five frames down and was on the brink of defeat at 9-5 behind, with Welsh left-hander Williams needing just one more frame.
The UK Championship winner in 1998 and 2000, Higgins was playing in his first major tournament since serving a six-month ban for failing to report a match-fixing approach.
And the Scot was also having to contend with the knowledge his father is suffering with cancer.
"I was a man on a mission. I was really determined to try and stop anything which prevented me from winning it," Higgins said.
"Given everything that surrounds it, this is my finest hour on the table," added Higgins, world champion in 1998, 2007, 2009
Victory also saw the 35-year-old join a select group of players who have won the UK, snooker's second most important tournament, on three or more occasions after Steve Davis (six), Stephen Hendry (five) and Ronnie O'Sullivan (four).
And it also meant Higgins, beaten in last year's UK final by Chinese cueman Ding Junhui, returned to number one in the world rankings ahead of Australia's reigning world champion, Neil Robertson.
Williams, the UK Championship winner in 1999 and 2002, said: "John's done well to come back to be fair to him.
"The best player in the tournament won but I had a chance to nick it and probably threw it away," he added.
Williams, world champion in 2000 and 2003, was a pot away from victory before he jawed what would have been the match-clinching red in the 17th frame.
A safety exchange then ensued before Williams potted a red and a black to go 29 points in front with only 27 left on the table.
But Higgins laid a snooker that saw Williams go in off after he missed the yellow with a serve shot.
And he then cleaned up on the remaining colours before levelling the match at 9-9.
Both players had chances in the final frame before Higgins sealed a dramatic comeback win with a superb double to pot the brown.