AP photo by Alastair Grant/ Cameron Smith looks at the claret jug trophy during the champion's news conference Sunday at the British Open. Smith closed with an 8-under-par 64 on the Old Course at St. Andrews, Scotland, for a one-stroke win at 20 under.

ST. ANDREWS, Scotland — The stage at St. Andrews was all set for Rory McIlroy.

The closing act belonged to Cameron Smith, and so did that silver claret jug he won in a show-stealing Sunday stunner at the British Open with the best final round ever played on the Old Course.

Smith was four shots behind at the start as a record crowd was eager to see McIlroy cap a week of celebrations at the 150th edition of golf's oldest major tournament in style. Smith was three behind when he made the turn.

And then the plucky Australian with his magical putter ran off five straight birdies to take the lead, stared down a nervy putt around the edge of the nefarious Road Hole bunker to save par and finished with two putts from 80 feet for a birdie for and an 8-under-par 64.

"To win an Open Championship in itself is probably going to be a golfer's highlight in their career," said Smith, who turns 29 in a month and can finally celebrate his first major title. "To do it around St. Andrews I think is just unbelievable."

So was his golf. In the 29 previous times the tourney was held here, no winner had ever closed with a 64. Smith finished at 20-under 268, a record score for the Old Course that matched the lowest score in relation to par at any major.

"I got beaten by the better player this week. To go out and shoot 64 to win the Open Championship at St. Andrews is a hell of a showing. Hats off to Cam," said McIlroy, the 33-year-old from Northern Ireland who won all four of his major titles from 2011 to 2014.

McIlroy hit every green in regulation Sunday and two-putted all of them — two were birdies, the rest were pars — for a 70 that left him in third place and having to wait nearly nine months before he can try to end his drought in the majors that now is at eight full years.

Smith won by one shot over PGA Tour rookie Cameron Young, the 25-year-old American who holed a 15-foot eagle putt on the final hole to tie for the lead, though just briefly. It wasn't enough, and neither was anything McIlroy could muster.

some text
AP photo by Gerald Herbert / Cameron Young plays out of the rough on the 13th fairway of the Old Course at St. Andrews during Sunday's final round of the British Open. Young shot 65 and finished second.

McIlroy couldn't make a putt early. He couldn't hit it close enough late. His last good chance was a 15-foot birdie attempt on the dangerous Road Hole at No. 17, and it narrowly missed to the left. McIlroy needed an eagle to tie Smith, and his chip through the Valley of Sin had no chance.

Smith won for the third time this year, all on entirely different courses — the generous fairways of Kapalua Resort in the Tournament of Champions, the visual intimidation of water at TPC Sawgrass in The Players Championship and the oldest links in the world with its double greens and pot bunkers.

He beat the No. 1 player in the Official World Golf Ranking at the time, Jon Rahm, to win at Kapalua. He beat the best field in golf at TPC Sawgrass. And he had to overcome a four-shot deficit against a heavy crowd favorite to win the British Open.

Even with the claret jug in his hands, it was hard to believe.

"All the names on there, every player that's been at the top of their game has won this championship," Smith said. "It's pretty cool to be on there. It really hasn't sunk in yet. I don't think it will for a few weeks. Yeah, it's just unreal."

Smith is the first Australian to win at St. Andrews since Kel Nagle in 1960, when he topped a rising American star named Arnold Palmer, the people's choice.

That's what McIlroy is now. He moved into the void left when Tiger Woods missed the cut Friday in what might have been his final British Open at St. Andrews. He had support that carried him to the cusp of winning at the home of golf — the "Holy Grail" as McIlroy had called it earlier in the tournament.

All day there was an energy along the humps and hollows of the Old Course, all of them waiting to celebrate McIlroy as a champion at St. Andrews, eight years after his lone British Open victory at Royal Liverpool. He gave them little to cheer.

"The putter went cold on me," McIlroy said. "When both Camerons — especially Smith — went on that run on the back nine, I had to dig deep to make birdies. And I just couldn't."

some text
AP photo by Gerald Herbert / Rory McIlroy walks off the 18th green of the Old Course at St. Andrews with his caddie on Sunday after closing with a 70 to finish third in the British Open at 18 under, two strokes behind winner Cameron Smith.

That left Smith, known for his grit and his putting stroke, on the 18th green to be introduced as the "champion golfer of the year."

Smith is the first Australian to win this event since Greg Norman in 1993 at Royal St. George's. Norman was asked not to return this year — there was no indication he was coming — because he heads the Saudi-funded LIV Golf Series that has offered millions to attract players including Bryson DeChambeau and Dustin Johnson, major champions who finished in the top 10 at St. Andrews.

This day belonged to Smith and his putter that answered every test.

McIlroy was playing controlled golf, his only birdie a two-putt from 18 feet on the par-5 fifth. Norway's Viktor Hovland, who started the final round tied with McIlroy, was never a factor. He didn't make his first birdie until the 12th hole and closed with a 74 to share fourth with England's Tommy Fleetwood (67) at 14 under, four behind McIlroy.

That run by Smith on the back nine is now part of British Open lore.

He hit a nifty pitch to five feet for birdie on the short 10th. He was bold to a back pin on the par-3 11th and holed a 15-foot birdie, and he birdied the next two holes from about that length. His fifth in a row was a putt from 90 feet on the par-5 14th, over a huge mound and down the slope to tap-in range that gave him the lead for the first time.

McIlroy couldn't catch up. His lag putting was terrific, but that wasn't what he needed. And he got no help from Smith, whose one missed shot set up his biggest challenge.

The Road Hole bunker was between him and the flag on the 17th. He used his putter to ride over the right edge of the bunker and onto the green, 10 feet away, and he poured in another putt, this one for par to stay in front.

Young had his chances in his first British Open. He left short a six-footer with about a foot of break on the 15th. He came up short with a wedge on the next hole. He drilled his drive and approach to the 17th, only to leave another birdie chance short.

He finally delivered, but all that got him was a 65 and the silver medal. In two majors this year, he missed a playoff by one shot at the PGA Championship and made his best putt too late at St. Andrews.

Smith made his last birdie and the engraver went to work on the claret jug, a prize first awarded to the 1873 champion at St. Andrews. There's a lot of history around this gray old town, and Smith became part of it in a big way.