Koepka, who displaced Dustin Johnson for the world's top ranking, shot a final-round 8-under 64 for a 21-under total of 267. Koepka, who had never held the top ranking, led by four strokes after three rounds.
"To be No. 1 is something I've dreamed of as a kid," Koepka said. "I don't think this one is going to sink in."
Gary Woodland certainly made it interesting. Woodland started the day five strokes behind Koepka, who was only 1-under after nine, but Woodland pulled level after making six birdies in seven holes on the front nine.
The two dueled on the back nine, with Woodland birdieing 15 and 16 to again pull level. But Koepka did the same, and a bogey by Woodland on the par-3 17th gave Koepka the cushion he needed to close out the win despite a birdie on the 18th by Woodland.
The biggest moment came on the 16th. Koepka went from a fairway bunker to just left of the green, about 70 feet away. Koepka hit a chip-and-run that was stopped by the pin and dropped for the birdie.
Koepka finished in style with a 25-foot eagle putt on the 18th for a 29 on the back nine.
"I'm not somebody who's going to panic if things go the wrong way," Koepka said of his slow start. "I felt like the one at 15 was quite big with Gary making a charge."
Woodland finished second after a 63. Ryan Palmer birdied his last seven holes to shoot a course-record 62 and finish in a tie for third place with Rafa Cabrera Bello (65), four strokes behind Koepka.
Woodland was happy with his final round, but looked back to a few missed birdie chances on Saturday.
"Brooks with the lead.not much fazes him," Woodland said. "So you knew you had to make a lot of birdies and I made a lot today. I was trying to put as much pressure as I could. But just shows I was too far back to start after not making too many putts yesterday. I gave myself a chance, I was tied for the lead there. Brooks obviously just made some clutch shots down the stretch."
Palmer said he became more confident with each of his seven straight birdies on the back nine.
"The more I made, the more free I felt in my swing and I was able to hit some close," Palmer said. "I made some long putts coming down the stretch. Actually on 17, I looked at my scorecard, I was like, 'oh, that's six in a row.' It is kind of back there, but you don't think about it. What a special day."
Defending champion Justin Thomas, who could have prevented Koepka from moving to No. 1 with a repeat win, finished at 5-under after a 68 Sunday.
Koepka is the third player this year to reach No. 1 for the first time, joining Justin Rose and Thomas. The last time that happened was in 1997, when Ernie Els, Tom Lehman and Tiger Woods each rose to No. 1.
It was Koepka's 12th victory worldwide, including four wins on the European Challenge Tour. He now has won in six countries - the U.S., South Korea, Spain, Italy, Turkey and Scotland.
"Everything I've done this year it's been working. So I don't want to change anything," Koepka said. "Just keep improving.
"I'm so excited right now, you have no idea. I can't wait to go play again."
He'll get his chance soon. Next week the PGA Tour heads to Shanghai for the final stop on its Asian swing, the World Golf Championships-HSBC Champions.
For more AP golf coverage: https://apnews.com/tag/apf-Golf and https://twitter.com/AP_Sports
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.