MEMPHIS, Tenn. — Justin Thomas won the FedEx St. Jude Invitational on Sunday to take the No. 1 spot in the world for the first time since June 2018.

Thomas dueled defending champion Brooks Koepka down the final holes, sealing the World Golf Championship victory on the par-5 16th. Thomas took the lead for good with his second straight birdie, while Koepka bogeyed the hole.

Koepka pulled within a stroke with a 39-footer for birdie on No. 17. But Koepka put his tee shot into the water along the 18th fairway on his way to double bogey, allowing Thomas to finish up an easy par putt for what wound up a three-stroke victory.

Thomas closed with a 5-under 66 to finish at 13-under 267 and take the $10.5 million winner's check for his 13th PGA Tour title. At 27, he became the third-youngest player since 1960 to reach 13 PGA Tour wins, trailing only Tiger Woods and Jack Nicklaus.

This was the fifth time Thomas rallied to win, and he matched his biggest comeback after starting the day four strokes back of third-round leader Brendon Todd. Thomas has three wins this season, two since the start of the year.

The last time Thomas was No. 1, he spent four weeks at the top of the ranking. He will supplant Jon Rahm, who became No. 1 after winning at Memorial two weeks ago.

Koepka will go to TPC Harding Park in San Francisco looking to defend his PGA championship title. He finished with a 69 and tied for second with Phil Mickelson (67), Daniel Berger (65) and Tom Lewis (66).

Thomas started Sunday with Jim “Bones” Mackay on his bag playing in the same group with Mickelson for the first time since Mickelson split with his longtime caddie. Thomas made up the deficit with four birdies on the front nine and just missed another birdie chance on No. 8. His 20-footer on No. 9 tied Todd at 12 under.

Todd, whose putting had carried him through the first three rounds, three-putted for bogey from 23 feet on the par-3 eighth, leaving Thomas alone atop the leaderboard.

Thomas put his second on the par-4 12th into a greenside bunker near the back edge and chopped it out to the rough. He chipped out from an awkward stance to salvage bogey.

That created a five-way tie at 11 under with Koepka, Berger, Lewis and Todd.

Koepka took the lead to himself on the par-4 13th. He hit his approach from 133 yards to 10 feet of the pin, and Koepka sunk the putt for his third birdie of the round to go to 12 under.

After hitting his tee shot 321 yards to the rough 51 yards short of the hole on No. 15, Thomas hit to 6 feet for a birdie, tying Koepka at 12 under with three to play. Thomas found the rough far right of the cart path on the par-5 16th, then hit his third from the left rough 65 yards to 3 feet for his second straight birdie.

Koepka, in the group behind Thomas, tried to answer 42 yards from the hole. His shot landed close to the hole only to keep rolling to the back of the green. Koepka wound up two-putting from 8 feet for bogey.

___

More AP golf: https://apnews.com/apf-Golf and https://twitter.com/AP_Sports