FARMINGDALE, N.Y. — Brooks Koepka’s heart rate, he said Saturday night, probably would not vary much whether he was sitting on the couch watching the 101st P.G.A. Championship or sizing up a putt on Bethpage Black’s 72nd green to win it.

“I’d say I’m pretty flatlined most of the time,” he said.

Fast forward to dusk on Sunday. Koepka’s face was flush with anxiety as he stood on the par-3 14th green studying his fourth consecutive bogey putt. Poised to become the first man to hold back-to-back titles in two majors simultaneously, Koepka suddenly was staring at a more ignominious piece of history: He was in danger of becoming the first player to blow a seven-stroke, final-day lead in any PGA Tour event, much less a major.

“I was just in shock,” said Koepka, who weathered a back-nine wobble precipitated by wind that gusted to 30 miles per hour to successfully defend his P.G.A. title. He closed with a four-over-par 74 for a 72-hole total of eight-under 272, two strokes better than his close friend and training partner, Dustin Johnson, who whittled Koepka’s lead to one before bogeying two of his last three holes for a 69.

Koepka, 29, supplanted Johnson as the world No. 1 and joined Ben Hogan, Arnold Palmer, Jack Nicklaus and Tiger Woods as the only men to win four major titles in less than two years. He will seek his fifth major title, and his third straight United States Open crown, next month at Pebble Beach.