It might have been fitting if someone from Holywood won this year’s U.S. Open at Los Angeles Country Club. But Rory McIlroy, born in the Northern Ireland town of Holywood, is not having that kind of year.

On Sunday, McIlroy was chasing his first major championship title in nine years, a drought that continues to shadow a luminous career that began with four major titles from 2011 to 2014. In April, he missed the cut at the Masters Tournament. A month later, he finished tied for seventh at the P.G.A. Championship.

Then, on June 6, McIlroy, the most vociferous loyalist supporting the PGA Tour in its feud with the Saudi-back LIV Golf circuit, learned only a few hours before news broke that the two tours had shockingly formed a business partnership.

McIlroy, like almost all of the PGA Tour’s players, felt blindsided.

But on Sunday, a buoyant, smiling McIlroy, 34, was again enthusiastically chasing another major title, in the final round of the 123rd U.S. Open. He birdied the opening hole and for most of the next four hours seemed poised to reel in the eventual tournament winner, Wyndham Clark, the third-round co-leader with Rickie Fowler.

McIlroy, however, never birdied another hole, and in the end, Clark, after some nervous closing moments, outlasted McIlroy by a stroke as both golfers shot even-par 70s. It was McIlroy’s third runner-up finish at a major and his 10th finish in the top five of a major since 2014.

“I fought to the very end, and I’m getting closer,” McIlroy said Sunday of his chase for a fifth major title, adding: “I just got to keep putting myself in these positions and, you know, sooner or later it’s going to happen for me.”

McIlroy said he felt a link between his performance on Sunday and his second-place finish at last year’s British Open at St. Andrews.

“The last two real chances I’ve had at majors have been pretty similar performances,” he said. “Not doing a lot wrong.”

McIlroy’s pursuit went down to the final strokes of the event, as Clark, playing in the final group of the day, was forced to execute a two-putt from 60 feet on the 18th green to clinch the championship.

McIlroy conceded that he was hoping for a miscue.

“You don’t want to wish bad on anyone, but you’re really hoping for a three-putt,” he said. “You’re hoping to somehow get into a playoff to keep giving yourself a chance. You’re rooting for one guy, and that guy is yourself at that point. A mistake can give you a glimmer of hope.

“But Wyndham was pretty much rock solid all day, and that was a great two-putt at the last.”

McIlroy’s fourth round began auspiciously as he reached the green on the par-5, 585-yard first hole with his second shot and two-putted for an opening birdie that briefly moved him into a tie for the tournament lead.

But he struggled to capitalize on that early momentum even as he registered par after par — a streak of 12 in all. He showed nerve in sinking several tense four-foot par putts but failed to get his approach shots close enough for easier birdie attempts.

McIlroy was hanging on but could not convert any putt longer than seven feet throughout the middle of his round. On the eighth green, he pulled an eight-foot birdie putt well left of the hole, a missed opportunity that McIlroy specifically mentioned in his post-round news conference.

At the par-3 ninth hole, McIlroy’s towering approach shot with an iron came to rest 14 feet from the flag. As he walked onto the green, fans in two packed grandstands implored him to make a fairly straightforward putt that would have put him in a tie with Clark, but again McIlroy could not seize the moment.

McIlroy’s run of consecutive pars ended at the par-5 14th hole after his tee shot bounded into the rough left of the fairway. He was forced to lay up short of the green with a second shot, although he then faced a short wedge shot to the green.

McIlroy later said he was choosing between two clubs for the shot, but he felt a wind gust just before he began his swing, and that impeded the shot’s momentum.

“I had the right club, but I might have just had to wait an extra 15 or 20 seconds to let that little gust settle,” he said.

McIlroy’s golf ball landed about a foot short of perfect and failed to clear a large bunker protecting the front of the 14th green. The ball embedded in a grassy bank between the sand and the green.

He was granted free relief in the grass to the right of the bunker, but his dicey, downhill chip to the green rolled 26 feet from the hole. That led to bogey, and McIlroy fell to nine under par, which extended Clark’s lead to two strokes.

McIlroy closed with four routine pars.

He was asked at the conclusion of his Sunday news conference if he was growing weary of answering questions about the nine-year wait for a fifth major championship victory. He conceded that it was exhausting but added: “At the same time, when I do finally win this next major, it’s going to be really, really sweet. I would go through 100 Sundays like this to get my hands on another major championship.”