Hayes birdied the first two holes, while Gamez bogeyed the second at the TPC at Deere Run. Instantly, a tie turned into a three-shot lead, and an advantage Hayes would never relinquish.
The 36-year-old shot 4-under 67 to finish at 22-under-par 262. Robert Gamez (71) birdied the par-5 17th and made a four-footer for par at 18 to finish in solo second, four back.
Hayes' 22-under total was a tournament record in relation to par. David Frost shot 21-under 259 in 1993 at the par-70 Oakwood Country Club, and still owns the aggregate record.
Hayes made only one bogey all week ' and that came in his second-round 61 ' in earning his first victory since his maiden tour title at the Buick Classic in 1998. He also collected his largest career paycheck of $540,000.
'I always believed I'd win again,' Hayes said. 'I'm going to go out and give it 110 percent every tournament and that will never change.'
More from Hayes on his win.
Gamez wasnt able to claim his first win since his rookie season of 1990, but his $324,000 payday ' also the biggest in his 13-year career ' was more than enough to ensure he can skip the qualifying tournament for the first time in five years.
'I played hard all day,' Gamez said. 'I hit a lot of good shots out there that just didn't turn out. J.P. played great for two days. He played a lot better than I did. It was nice to see somebody play well and win instead of me playing poorly and losing.'
Hayes, who birdied his final three holes in Round 3, quickly moved to 20-under after two holes Sunday. And though he parred Nos. 3-10, no one stepped through the open door.
After dropping a shot at the second, Gamez posted a lone birdie over his next 14 holes.
Hayes moved four clear of the field with a birdie at the 11th, and then reeled off another five pars before closing with a birdie at 17.
'For some reason I really felt confident,' Hayes said. 'That's as good as I can play under the circumstances. I'm just tickled to death. It means so much to me.'
Final results from the John Deere Classic