The left-hander claimed his fourth PGA Tour title as he recovered from a mid-round wobble when his overnight three-stroke lead was cut to one to card a three-over round of 75 in gusting winds at TPC San Antonio on Sunday.
The conditions were so difficult that four players, including Tommy Fleetwood, failed to break 80 and the course played to an average score of 74.8.
Ryan Gerard posted a 69 to claim second while Andrew Novak's hopes of a Masters invitation, which would have come with a win, evaporated late in a closing 76 as he tied for third with Maverick McNealy (72).
Harman's bogey at the 16th put Novak back in the frame but he missed his opportunity with a duffed chip from the back of the 17th green costing him a shot.
And when Novak dragged his drive into the heavy rough at the par-five last any slim hopes were over and Harman could finally relax.
"The last two days felt like they took an eternity, with the wind it felt like a nightmare out there," said Harman, who won with a nine-under 279 score.
Fellow American Gerard was also hoping to snatch a late trip to Augusta but after reaching the turn in 33 he managed only one birdie on the back nine.
Harman had been struggling since his major breakthrough at Hoylake and was on the verge of falling out of the top 50. Now he heads to the Masters with a much-needed win.
Adding to the difficult of the conditions was his mind being on a close family friend, Cathy Dowdy.
She spent time in a coma after helping to rescue Harman's six-year-old son from a rip current in Ponte Vedra Beach, Florida, last October while his family was on vacation.
"Just playing with a heavy heart today. Ms. Cathy, she's not doing so good," Harman said. "Just thinking about her all day."