The three-time Major Championship winner’s last triumph on Tour was his 2008 win at the US PGA Championship and he showed all his experience under pressure in a closing bogey-free 65 to get to 23 under.
That was one shot better than Sullivan who also closed his week at Victoria Clube de Golfe with a 65, and two better than the semi-retired Anders Hansen and Finn Mikko Korhonen - who secured his playing privileges after starting the week 116th on the Race to Dubai.
The victory took Harrington’s European Tour tally to 15 wins and moved him alongside Thomas Bjørn at 15th on the all-time list.
“I haven’t won yet this year, so I know the year is nearly done, it’s always important to get a win every year, a winning year,” he said.
“It’s a big win. Portugal Masters is a big tournament. I’ve been coming here for ten years so I’ve always liked it down here. I’ve always liked coming down to Portugal.
“There are so many Irish people here. It always felt like a home away from home, so it’s really nice to win the tournament.
“I tried to be really aggressive. The golf course suited me and I just tried to go after every pin I could and make birdies. I have a pretty good short game that was on form this week. No matter where I hit it, I felt like I could get it up and down.”
Englishman Sullivan was attempting to become the first man to successfully defend the title while Denmark’s Hansen - who retired at this event in 2015 and was making just his fifth 2016 appearance - was looking to claim his first win since 2009.
Sullivan made a stunning start, birdieing four of his first five holes to get to 20 under, while Korhonen birdied the second and fourth and when Hansen had gains on the fourth and fifth, there was a three-way tie at the top.
A brilliant bunker shot from Harrington helped set up a birdie on the second but when Hansen made a third birdie in a row on the sixth, the Irishman found himself three shots off the lead.
He cut that gap to two with a birdie on the seventh and then holed an exquisite bunker shot on the 11th before following it with another birdie on the 12th. Sullivan had also taken advantage of the par five and once again, there were three players at the top of the leaderboard.
Harrington spun his approach on the 14th back to five feet to move ahead but Sullivan took an aggressive line over the water on the 17th and joined him at 22 under.
A third birdie of the week on the penultimate hole followed from Harrington, however, and he parred the last to claim a dramatic victory.