Rahm, who held a share of the lead on day one and was two shots clear after 36 and 54 holes, carded a final round of 69 at Vidanta Vallarta to finish 17 under par, a shot ahead of Tony Finau, Brandon Wu and Kurt Kitayama.
Finau and Wu both shot 63 to set the clubhouse target, but Rahm made a crucial birdie on the par-five 14th and parred the last four holes to secure the win.
Rahm had not tasted victory since claiming his maiden major title in last year's US Open, a barren run which saw him replaced as world No.1 by Scottie Scheffler, whose Masters triumph was his fourth win in the space of 57 days.
A tie for 27th was the joint worst performance of Rahm's career at Augusta National after four straight top-10s, but the 27-year-old Spaniard was still made a strong favourite for the Mexico Open title at the start of the week.
"I don't really look at bets or anything like that, I like to think every time I tee it up I'm the favourite because I'm out there to win and I've been playing pretty good the last few years," Rahm told CBS.
"It was a pretty stressful weekend all the way to the end. I didn't think having a par-five (18th) where a fade off the tee was required I would be stressing this much, but I got it done at the end.
"I let my frustrations out a few times out there but I stayed positive and hopeful and I think it showed in my swings. It wasn't my best putting weekend but I stayed aggressive and I think the shot on 17 showed that.
"I was confident in what I was doing, I had faith in every part of my game. A couple of those great par putts early on helped out a lot and the one putt from outside five feet that finally went in on 14 was a huge booster."
Matt Jones was the leading Australian, tied for 59th at four under.