Mahan, who won the WGC-Accenture Match Play Championship in February, shot a one-under-par 71 in Sunday's final round at Redstone for a 16-under-par total of 272 in the last event before the US Masters.
"It feels great to come to 18 knowing you got to have a par to win and hit two good shots and make an easy two-putt. Feels great," Mahan told reporters after claiming his fifth career victory on the US Tour.
Mahan, 29, said the victory boosted his confidence and that he was looking forward to attempting to capture his first major championship at Augusta National starting on Thursday.
"I'm playing good. I'm glad I'm going to Augusta, it's really a special place and I'm looking forward to going there."
Pettersson, who held the lead before a two-shot swing in the middle of the round put Mahan back on top of the leaderboard, also posted a 71 for 273.
Former Open champion Louis Oosthuizen of South Africa began the day with a two-stroke lead but double-bogeyed the fifth and eighth holes to slide back.
Oosthuizen, who romped to a seven-stroke victory at the 2010 Open, got back on track on the back nine with three birdies to complete a 75 and finish third at 274.
Tied for fourth place at 14-under 276 were Americans Phil Mickelson (71), Keegan Bradley (71) and Jeff Overton (68) along with Briton Brian Davis (74).
"I didn't hit the ball close enough with my irons," said Mickelson, who won the tournament last year.
"My iron play wasn't the best this week, and then when I had a lot of good putts that came close, they didn't quite fall like last year."
Pettersson used a birdie at the first and another at the fourth hole to move into the lead as Oosthuizen struggled.
But the burly Swede bogeyed the 10th as Mahan ended a string of eight successive pars with a birdie at the ninth to take the lead. Mahan added a stroke to his advantage with another birdie at the 10th.
Mahan, who stood second after three rounds, gave back a stroke with a bogey at the par-three 14th, but held his nerve down the stretch.
Holding a one-shot lead, the American hit a perfect drive at the 488-yard par-four 18th and striped a seven-iron on a line just past the pin and two-putted for victory.
Pettersson had one last chance to pressure Mahan, but his birdie putt at the 18th came up short.
"I played really good today," the Swede said. "I couldn't make a putt on the back-nine. I gave myself good chances coming in. Just a little (disappointed) I left it short on 18."
Ernie Els was one of a number of players who needed a win at Redstone in order to qualify for next week's Masters.
The big South African, who has played in the last 18 Masters, posted a final-round 70 to finish tied for 12th on 278.