AUGUSTA — Rory McIlroy was never really in contention to win the elusive Masters. That was a two-man race between Scottie Scheffler and Cameron Smith when fourth-round play began Sunday.

But that didn’t mean McIlroy couldn’t make a run at third place.

Or better yet, second place.

An improbable second-place finish was just what McIlroy accomplished as he shot a final-round 64 and finished three strokes behind winner Scheffler. After some dramatics on the 18th hole, McIlroy said it’s the happiest he’s been on the golf course. And this from a man with four major championships, needing only the Masters to complete the career Grand Slam.

“It’s what you dream about, right?” McIlroy said. “You dream about getting yourself in position. I wasn’t quite close enough to the lead, I don’t think. Scottie is playing really, really well. To play as well as I did today and then to finish like this, I mean, it’s just absolutely incredible.

“This tournament never ceases to amaze. Yeah, that’s as happy as I’ve ever been on a golf course right there.”

McIlroy began the final round in a five-way tie for ninth place at 1 over par, 10 strokes behind Scheffler and seven strokes behind Smith. He announced his presence with birdies on Nos. 1, 3, 7, 8 and 10 (a chip-in). That put McIlroy at 4 under par and in third place.

McIlroy made another big move with an eagle at No. 13. He went to 6 under par, now a stroke behind Smith, who was playing No. 9. He was firmly in third place as others near the top of the leaderboard stalled or fell back.

So, how about second place?

That came two holes later. As Smith (and Scheffler) bogeyed No. 10, the two were both 6 under par, four strokes off the lead. While Scheffler and Smith were having issues at No. 10, McIlroy just missed a birdie putt on No. 15 that would have given him sole possession of second place.

Smith quickly took back second place with a birdie on No. 11 to get back to 7 under par.

One hole later, McIlroy had his second-place spot for good. Smith took a triple-bogey 6 on the par-3 12th with a tee shot that found water. He dropped to 4 under par. McIlroy scrambled to save par on No. 17, while Smith’s unfortunate dramatics were playing out behind him.

Yet another hole later and both McIlroy and Smith were throwing clubs – for much different reasons.

McIlroy holed out from the bunker on No. 18 for birdie to finish at 7 under par for the tournament. The blast from the sand set off a wild celebration. He tossed his club in elation, hugged his caddie, raised his hands in celebration to cheering fans and tossed the ball into the crowd.

Smith, on the other hand, was not happy with a chip to No. 13 after a layup dangerously close to Rae’s Creek. He slammed his club in frustration as he walked to the green. He managed to save par to remain three shots behind McIlroy. Meanwhile, Collin Morikawa holed out from the same bunker as McIlroy minutes later to also get to 4 under par and push Smith further down the leaderboard.

Smith would drop as low as 3 under par. Two straight birdies, on Nos. 15 and 16, put Smith back to 5 under par where he ended the tournament, a tie for third with Shane Lowry.

For McIlroy, it’s his best finish in a Masters, topping the fourth he posted in 2015. In his 14th tournament, McIlroy now has four top-5 and seven top-10 finishes at Augusta National. That final major is still missing from his resumé, but he came quite a bit closer to the elusive title Sunday.

“I’ve always known that I can do it,” McIlroy said. “I’ve played good enough around here, maybe just haven’t strung four rounds together like that, but I’ve always known that I have the game to win at this place. It’s just a matter of having that game for four days in a row and not making big numbers and shooting yourself in the foot, I guess.

“That was my attitude the first couple of days. I certainly didn’t do that. I played for pars quite a lot, but in the course of a tournament, you are going to find some spots where you go on a birdie run, and you try to take advantage of some of the good golf that you play, and I did that today.”