Adam Scott contemplated the safe shot to get him out of his mess on the 15th hole at Riviera, knowing it would probably cost him his two-shot lead but not yet the tournament.

On a Sunday filled with big blunders and untimely mistakes, Scott changed his mind.

“I thought, ‘Well, you can maybe win the tournament if you hit a great flop shot here.’ So I thought I might as well go for it,” Scott said after his two-shot victory in the Genesis Invitational, this one that counts in the record book.

The flop shot to 5 feet allowed him to escape with bogey. Two holes later, he ran in a 10-foot birdie putt for a two-shot cushion and carried that to a 1-under 70 and a win that felt overdue.

Scott won the Australian PGA two months ago and hadn't played since then. Still, it had been nearly four years since his last PGA Tour victory. That changed at Riviera, his favorite course, on a final day so tough no shot shot better than 68.

Scott made clutch putts for birdie, par and bogey. But it was that decision — and the shot — that stood out.

“I had a little bit of that kind of mindset, not just today but the whole week, of ‘what have I got to lose?’ ... Give myself a good chance to get back in the winner's circcle on the PGA Tour,” he said.

The victory comes 15 years after Scott won a playoff at Riviera that didn't count as official because rain shortened the tournament to 36 holes. He earned every bit of this victory, his 14th on the PGA Tour and 29th worldwide.

So tense was Sunday that nearly a dozen players had a chance to win. Five players had a share of the least at some point.

The list included Rory McIlroy, who never recovered from a triple bogey; Harold Varner III, who chunked his 3-wood off the 10th tee so badly that the shot traveled 129 yards and led to double bogey. Matt Kuchar went 15 holes with three bogeys and no birdies to fall behind.

“Honestly, I didn't expect it to be as difficult as it was, but everyone was finding it tough out there,” McIlroy said after a 73 that left him in a tie for fifth, but still No. 1 in the world. “Adam held on well at the end.”

Tiger Woods had his problems, too, but he was never in contention.

Woods played a five-hole stretch late in his round at 5 over and shot 77 to finish last among the 68 players who made the cut. It was the first time Woods has finished last alone since the Memorial in 2015.

“Good news, I hit every ball forward, not backwards, a couple sideways,” Woods said.

The final round became wide open after the fifth hole when Scott and McIlroy hit shots that bounced over the green and across a series of swales. McIlroy tried to bump a shot into the hill and it came up short and rolled back. He flopped the next one about 20 feet away and three-putted for triple bogey.

On the par-3 sixth, he hit it on the wrong side of the bunker in the middle of the green and dropped another shot.

Scott tried a flop behind the fifth green that came up short. He went to his long putter, barely got it up the hill and onto the green and made double bogey. The difference was the next hole. He made an 18-foot birdie above the hole.

“It's not time to get flustered and try something new on the sixth hole of the final round,” Scott said. “I just really tried to do what I had done all week on that next swing and made a good swing and made a good putt. That gave me the belief that I just had to keep doing that all day and believe that there was enough good golf in me to get me in a position at the end to have a chance.”

He finished at 11-under 273 and moved to No. 7 in the world, his first time in the top 10 in nearly three years.

Scott won by two shots over Sung Kang, who started eagle-double bogey and shot 69; Scott Brown, who played bogey-free on the back nine and birdied the 18th for a 68; and Kuchar, who had a 72.

Hideki Matsuyama made the cut on the number and finished three shots behind in a tie for fifth with McIlroy, Bryson DeChambeau, Max Homa and Joel Dahmen.

“I'm stoked with this," Scott said. “It's a big step, whatever point in my career I'm at. I haven't won for three years. This feels very special.”

It showed at the end. He rapped in a 3-foot par putt, stood back and raised his right fist in the air. This victory was a long time coming, and it came on his favorite PGA Tour course. And this time, it counted.