ORLANDO, Fla. — The connection Rory McIlroy had with Arnold Palmer was strong even before he delivered a Sunday charge that would have made the King proud.

McIlroy first played the Arnold Palmer Invitational three years ago, and Palmer teared up at dinner when he asked McIlroy if there was anything he needed and received this reply: "Mr. Palmer, thanks to you, I have everything I could ever need in my life."

McIlroy's last victory was at the Tour Championship on Sept. 25, 2016, the day Palmer died.

Sunday was special for so many reasons.

Tiger Woods brought Bay Hill to life when he pulled within one shot of the lead, only for McIlroy to respond to the endless cheers and chants for Woods by running off five birdies over the last six holes to pull away. McIlroy closed with a 64, just like the last time he won. And he ended his longest drought in eight years by winning on the course and tournament that Palmer built.

The only thing missing was having the King around to celebrate.

"I wish he would have been at the top of the hill to shake my hand when I came off the 18th green there," McIlroy said. "But hopefully, he's proud of me with the way I played that back nine. I tried to be as aggressive as I could and tried to take on shots when I needed to, just like he would have. So yeah, it's come full circle since that day in September in 2016, and just proud to be sitting up here and have my name on that trophy."

It really was the perfect ending.

Bay Hill was rocking all afternoon, mostly for that red shirt. Woods, who started the final round five shot behind, made three birdies in a four-hole stretch to start the back nine and was within shot of the lead as everyone behind him on the course appeared to stall.

One shot changed everything.

Woods couldn't commit to a swing with his driver on the par-5 16th hole and sent it far and left — way left — over a fence and out-of-bounds, sending him to a bogey when he couldn't afford anything less than birdie.

He finished bogey-bogey-par for a 3-under 69 and tumbled down the leaderboard into a tie for fifth.

That's about when McIlroy pulled away.

The charge was vintage Palmer — birdie putts on the 13th and 14th, a chip-in from 40 feet on the 15th, a 375-yard drive on the 16th that left him a sand wedge into the par 5 for a two-putt birdie.

The final putt was vintage Woods.

McIlroy faced one last challenge from Bryson DeChambeau, who had closed to within one shot with an eagle on the 16th hole. McIlroy saw the score posted on the leaderboard to the right of the 18th fairway, and he answered with a 7-iron over the water on the 18th to about 25 feet above the hole.

It was the type of putt the gallery has seen Woods make to win in 2001, 2008 and 2009.

McIlroy buried it , raised both arms in the air and turned to slam his fist as the grandstands erupted with cheers.

"I've seen Tiger make that enough times to know what it does," McIlroy said. "So I just wanted to try and emulate that. ... Just to be able to create my own little bit of history on the 18th green here is pretty special."

That gave him a two-shot lead, and he was a winner for the 22nd time worldwide when DeChambeau failed to hole out from the fairway for eagle. DeChambeau made bogey from the bunker on the 18th for a 68 and finished alone in second.

Justin Rose lingered all day but was never a threat over the final hour, instead watching McIlroy put on a stunning charge.

"Rory played incredible golf and it was fun — great to see world class players do that," Rose said after a 67. "It's not great to see him make putts because he was making them against me. But when he is making putts, he's incredibly hard to beat. So it was fun to watch him play."

Stenson lost a third chance in four years to win the Arnold Palmer Invitational. He led by as many as two shots on the front nine before the putts stopped falling. Two shots behind playing the 16th, Stenson three-putted for par and bogeyed the final hole for a 71. He finished fourth.

Woods tied for fifth with Ryan Moore (71), and now heads to the Masters with plenty of momentum — just not a victory.

He finished one shot behind last week at Innisbrook. He was one-shot behind with three holes to play at Bay Hill, though it would have needed more than just a few birdies the way McIlroy played.

His next stop is the Masters, where Woods will be a favourite to win his fifth green jacket. And to think that just over six months ago, Woods hadn't been cleared by his doctors to hit balls after fusion surgery on his lower back, his fourth back surgery dating to the spring of 2014.

"If you would have asked me at the beginning of the year that I would have had a chance to win two golf tournaments, I would have taken that in a heartbeat," he said.

McIlroy was relieved for other reasons. He went through an injury-plagued 2017 and failed to win anywhere in the world. He was coming off a missed cut a week ago in the Valspar Championship. And now he's a winner again, with the Masters looming.

McIlroy needs only a green jacket to complete the career Grand Slam.

"I kept saying I didn't need a win going into Augusta to feel like I had a chance," McIlroy said. "I just wanted to see signs of good golf. And thankfully, I've been able to get both today."

He ended the night wearing the red sweater that goes to the winner, and raised a glass of Ketel One vodka — Palmer's favourite — to toast the King.

McIlroy took a swig and said, "Wooo! Strong."

Just like his finish.