The American entered the day in a share of the lead, with Fleetwood six shots behind him but when the Race to Dubai champion signed for a brilliant, record-equalling 63, he was just one stroke behind Koepka.
Fleetwood then faced an anxious wait of over two hours to see if he had done enough to claim his first Major Championship, but Koepka came home in 35 to sign for a 68, a one over total and a one-shot victory.
The win makes Koepka the first man to win back-to-back US Opens since Curtis Strange in 1989 and the first to win consecutive Majors since Padraig Harrington won his second Open Championship in 2008.
Fleetwood’s 63 - on the 45th anniversary of Johnny Miller shooting the same score to win this title at Oakmont - equalled the record for both the lowest score in US Open history and the lowest score on the final day of a Major.
World Number One Dustin Johnson finished at three over, a shot clear of Masters Tournament champion Patrick Reed and two ahead of another American in Tony Finau.
England’s Tyrrell Hatton and Swede Henrik Stenson were then at six over alongside American pair Daniel Berger and Xander Schauffele.
Koepka made his breakthrough on the Challenge Tour, winning four times before graduating in 2013 and this is his third European Tour title, with his maiden victory coming at the 2014 Turkish Airlines Open.
“I probably couldn’t have dreamed of it in my wildest dreams,” he said. “It’s really incredible, I couldn’t be happier.
“We grinded our tail off this week to come back from seven over and to do what we did. It was pretty special.
“The US Open just takes so much discipline. You have got to be a great putter and just kind of let things roll off your back. I enjoy the test, I enjoy being pushed to the limit.”
The 28-year-old holed a 20-footer on the second to edge ahead at two over and when he put an approach to four feet on the next, he was two ahead.
Reed made a brilliant start, birdieing his first three holes with approaches inside ten feet and a 20-foot putt on the par five fifth cut the lead to one.
Koepka also made the most of the par five after getting on the green in two but Reed hit a wonderful tee-shot into the seventh and when Koepka sent his tee-shot right on the sixth, he shared the lead with Reed and was just one ahead of Fleetwood.
The Englishman made a fast start with the putter, holing a 50-footer on the second and a 19-footer on the third to get to seven over. A stunning approach to the sixth and a nice tee-shot into the next had him right in the mix before he dropped a shot on the ninth.
The 27-year-old needed a response to that disappointment and he holed another long putt on the 12th before leaving himself a tap-in on the next.
His hot streak with the putter continued with a 20-footer from off the front of the 14th and a putt from 30 feet on the 15th, and he was the man to catch with a place in the history books.
Reed bogeyed the ninth, 11th and 12th to fall back and Koepka produced an excellent display down the stretch, hitting an approach to seven feet for a birdie on the tenth before doing very well to drop a single shot on the next after finding a nasty spot off the tee and getting up and down from a bunker.
A par save after a poor drive on the 14th kept him in the lead and a stunning approach to four feet on the 16th set up a pressure-releasing birdie and allowed for a dropped shot on the last.
Johnson never really got going as he signed for a level par 70 with four birdies and four bogeys, while Reed went on to birdie the 15th and bogey the last in a 68.
Finau recorded a 72 thanks to a double-bogey on the last to claim solo fifth.
Hatton and Stenson signed for rounds of 69 and 71 respectively, with Schauffele carding a 68 and Finau returning a 72.