Thomas, who began the day four shots off the lead, fired a five-under par 65 final round to thwart Koepka’s repeat bid and take the title at TPC Southwind in Memphis, Tennessee, on a 72-hole total of 13-under 267.
“It means a lot, especially with how I felt like I did it,” Thomas said. “In the past, I struggled with coming from behind. I got wrapped up in how far I was behind and how many people.”
The 27-year-old American became the third-youngest US PGA Tour player in the past 60 years to reach 13 career wins, behind Tiger Woods and Jack Nicklaus and just ahead of Rory McIlroy.
Koepka, who seeks a third consecutive PGA Championship victory next week in San Francisco, closed with a double bogey after finding water off the 18th tee and slid into sharing second on 270 with US compatriots Daniel Berger and Phil Mickelson and England’s Tom Lewis.
Thomas, the 2017 PGA Championship winner, jumped from third past McIlroy and top-ranked Spaniard Jon Rahm to retake world number one, a spot he held for four weeks in 2018.
A back-nine shootout saw Americans Koepka, Thomas, Berger and 54-hole leader Brendon Todd deadlocked with Lewis for the lead on 11-under while Australian Jason Day, American Chez Reavie and England’s Matthew Fitzpatrick were on 10-under.
Koepka sank a birdie putt from just inside 10 feet at the par-4 13th to seize the lead at 12-under.
Thomas found the left rough at 15 but blasted his approach to six feet and made the birdie putt to match Koepka for the lead.
Thomas then sent his tee shot way right at the par-5 16th, but recovered by blasting to the low rough just left of the fairway and dropped his approach three feet from the cup, tapping in a birdie to claim the lead alone at 13-under.
“I got unbelievably lucky,” Thomas said. “Somehow, that calmed me down. You usually only get lucky like that when you win the tournament.
“Luckily, I hung on and stayed patient and positive.”
Koepka scrambled on 16 but missed an eight-foot par putt to fall two adrift, only to sink a 40-foot birdie putt at the par-3 17th to move back within a stroke as he walked to the 18th tee.
But Koepka sent his tee shot into the water and put his third into a greenside bunker, sealing the victory for Thomas.
Mickelson matched a third-place effort at Pebble Beach for his best result of the season as the world’s top golfers set their sights on TPC Harding Park and next week’s first major tournament of a year in which COVID-19 has played havoc with the schedule.
The British Open was called off, the PGA was moved from May to next week, the US Open shifted from June to September and the Masters moved from its traditional first major spot in April to November.