The 28-year-old Northern Irishman birdied five of the last six holes as he signed off with a seven-under-par 64 for an 18-under-par 270 total, winning by three shots from American Bryson DeChambeau.
England’s Justin Rose was a shot further back in third, with Swede Henrik Stenson fourth on 13-under and Tiger Woods sharing fifth after another encouraging effort.
It was McIlroy’s first victory since he clinched the Tour Championship in Atlanta in September 2016.
That victory came on the day the golfing world lost Arnold Palmer and McIlroy returned to the winner’s circle with a performance “The King” himself would have been proud of.
Two behind Stenson at the start of the final round, the four-time major winner made his move with three birdies in four holes to end the front nine.
By that time, it had turned into a five-way battle for the title, with Woods staying in the hunt for his ninth win in the event until he drove out of bounds at the par-5 16th.
McIlroy had struggled with his putting since starting his 2018 PGA Tour campaign but, as so often happens with him, that club suddenly turned red-hot.
He holed from just off the green at the 13th before rolling in a 21-footer with a left-to-right break at the par-3 14th to take a two-shot lead.
He was then faced with a tricky up and down at the 15th but produced a moment of pure magic to chip in for another birdie.
A fourth in succession followed at the par-5 16th and, after narrowly missing with his attempt for a 2 at the penultimate hole, McIlroy signed off in style by holing another lengthy birdie putt at the last.
“It was awesome,” he said afterwards, having returned to the world’s top 10 with his 14th PGA Tour victory. “I’ve missed it, I really have missed it. I’m really proud of myself, and just so happy to get the win.
“I was even par through five, I kept telling myself to be patient. I think I gave myself a chance for birdie on every hole except 15 - and I made birdie there! I played a perfect round of golf.”
Woods, who was just a shot off the lead after covering the first 15 holes in five-under in the closing rounds, has now finished in the top 15 in his last three events
“I’m starting to piece it together, tournament by tournament, and each tournament’s gotten a little crisper and a little bit better,” he said afterwards.
“If I can play with no pain, and I can feel like I can make golf swings, I’ll figure it out.”
Martin Laird, the 2011 winner, closed with a 69 - his best score of the week - to finish joint-26th on four-under but Russell Knox (75) had to settle for joint-73rd on eight-over.
Elsewhere, England’s Laura Davies recorded her best finish since 2007 as she held on to tie for second at the Founders Cup.
The 54-year-old, who is in her 32nd year of the LPGA Tour, carded a final round of three-under 69 to give her a total of 14 under par for the tournament.
It left her five shots behind winner Inbee Park, but tied for second alongside America’s Marina Alex and Thailand’s Ariya Jutanugarn.
Speaking to the LPGA Tour website, Davies described the result as “amazing” - especially following a disappointing opening round in which she finished on one over par.
“This is incredible, really,” she said. “I was four-over after six (holes) and now I’ve finished tied second.
“I know I’ve been playing really well and I haven’t had the results to reflect that. I’m just delighted the way the week has turned out.”
Had she won the tournament - which would have been her first LPGA win since 2001 - Davies would have become the oldest champion in the organisation’s history.
But she has no plans to let the chance of claiming that record go just yet, joking: “Now people might stop asking me when I’m going to retire - that’s the best thing about it.”
Scottish No 1 Catriona Matthew finished joint-20th after signing off with a 69 for a nine-under total.