SAN DIEGO (AP) - Whether it was destiny or karma was of no relevance to Jon Rahm. He won the U.S. Open on Sunday at Torrey Pines, the perfect time and the perfect place to become a major champion.

How it unfolded was beyond his dreams.

One shot behind and running out of holes, Rahm made a sweeping, left-to-right birdie putt from 25 feet on the 17th hole to tie for the lead, and closed with another bending 18-foot birdie putt that gave him a one-shot victory over hard-luck Louis Oosthuizen.

No one had ever birdied the last two holes to win the U.S. Open by one shot in the previous 120 editions of the toughest test in golf until Rahm's storybook finish.

“It had to happen in a beautiful setting like this,” he said.

At Torrey Pines, where he made a 50-foot eagle putt on the final hole to clinch his first PGA Tour victory.

On Father's Day, with his 10-week-old son in his arms and his father having flown in from Spain to witness his son winning his first major to return to No. 1 in the world.

And just two weeks after his six-shot lead was wiped out at the Memorial because of a positive COVID-19 test that knocked him out of the tournament and cut into his U.S. Open preparations.

“It felt like such a fairy tale story that I knew it was going to have a happy ending,” Rahm said after those two career-changing birdies gave him a 4-under 67. “I could just tell, going down the fairway after that first tee shot, that second shot, and that birdie, I knew there was something special in the air. I could just feel it.

“I just knew that I could do it and believed it.”

He picked up two prizes Sunday. First, he cradled young Kepa when he walked off the 18th green with the roars still ringing in his ears. Then, he hoisted that silver U.S. Open trophy, the first champion from Spain.

Rahm was on the practice range when Oosthuizen, who fell two shots behind with a most untimely tee shot into the canyon that led to bogey on the 17th hole, failed to hole out his wedge for eagle at the end.

“Little man, you have no idea what this means right now,” Rahm said to his son. “You will soon enough.”

The final round was so tight that six players had a share of the lead at some point, and there were 10 players separated by a single shot.

And then that special brand of U.S. Open chaos hit everyone but Rahm, the only contender not to drop a shot on the back nine.

Four players who were within one shot of the lead on the back nine made double bogeys, a list that included a shocking meltdown by defending champion Bryson DeChambeau.

No one was immune from trouble. Oosthuizen, who had a two-shot lead after his 30-foot birdie putt on No. 10, was the last to fall.

Trailing by one shot, Oosthuizen drove into the canyon left of the 17th fairway for a bogey that left him two shots behind, and then he missed the fairway on the par-5 18th that kept him from going for the green for a look at eagle to force a playoff.

He settled for a birdie and a 71. It was his second straight runner-up in a major, and his sixth silver medal since he won the British Open in 2010 at St. Andrews.

“Look, it's frustrating. It's disappointing,” Oosthuizen said .“I'm playing good golf, but winning a major championship is not just going to happen. You need to go out and play good golf. I played good today, but I didn't play good enough.”

Only two weeks ago, Rahm was on the cusp of another big win. He tied the 54-hole record at the Memorial and had a six-shot lead, only to be notified as he walked off the 18th green that he tested positive for the coronavirus and had to withdraw.

Worse yet, his parents had flown in from Spain to see their new grandson, and Rahm was in self-isolation and couldn't be there for a special moment.

Sunday made up for it. His parents were at Torrey Pines to witness a world-class performance capped off by one of the great finishes in U.S. Open history.

“I'm a big believer in karma, and after what happened a couple weeks ago, I stayed really positive knowing good things were coming,” Rahm said. “I didn't know what it was going to be, but I knew we were coming to a special place.

“I just felt like the stars were aligning, and I knew my best golf was to come.”

For so much of the back nine, it was utter chaos with blunders that can define a U.S. Open.

DeChambeau, trying to become only the fourth player since World War II to win back-to-back in the U.S. Open, took the lead with an 8-iron that stopped inches away from a hole-in-one on the par-3 eighth. He had gone 30 consecutive holes without a bogey.

And then his lack of accuracy off the tee cost him. A bogey on No. 11. A bogey from deep rough on No. 12. And then on the par-5 13th, DeChambeau went from deep rough to deep rough to bunker, blasting out of the sand over the green next to a beer box, making double bogey.

He took a quadruple-bogey 8 on the 17th hole with a shot in the canyon and a shank. He shot 44 on the back nine for a 77.

“I didn't get off the rails at all. It's golf,” DeChambeau said. “I've had plenty of times where I hit it way worse than today and I won. It's just one of those things where I didn't have the right breaks happen at the right time.”

Mackenzie Hughes, one shot behind going to the back nine, had his tee shot on the par-3 11th bounce off a cart path and get stuck in a tree, leading to a double bogey that ended his chances. Former PGA champion Collin Morikawa chopped his way down the 13th for double bogey that took him from one shot behind to out of the mix.

Rory McIlroy wasn't immune, either. With a chance to end his seven-year drought in the majors, McIlroy made a careless three-putt for bogey on the 11th when he was one shot behind, and then caught a bad lie in the bunker that led to double bogey on No. 12.

Rahm's passion was on a full display when those winning putts dropped. When it was over, he never looked more at peace with that U.S. Open trophy at his side.

“This one is very, very incredible, very hard to believe, that this story can round up and end up so good,” he said. “It almost feels like it's a movie that's about to end and I'm going to wake up soon.”