The Spaniard gave it a good run, but his chip missed a few left of the hole.
That gave Hanson his fifth victory on the European Tour and first since 2010.
Hanson shot a 3-under 67 and finished at 14-under 266.
He won by two strokes over Larrazabal, a third-round co-leader, who parred the last for an even-par 70, and last week's European Masters winner, Richie Ramsay, who posted a 3-under 67.
This was a tough week for Hanson off the course.
His 1-year-old son, Tim, was back at home in Arnold Palmer Hospital for Children in Florida with a respiratory virus known as RS. The virus is contagious so his family persuaded him to stay and play the event.
Hanson didn't sleep on Friday night, but on Sunday, with Tim improving back in Florida, where Hanson, a Swede, is now based, it was a great day for the Hanson family.
"It was especially hard yesterday," admitted Hanson. "I didn't sleep a lot because I was getting updates from my wife and the doctor every hour between Friday and Saturday night.
"I kind of calmed down a little bit yesterday evening when I heard he was over the worst bit of it and feeling better. I was a bit better today."
Scott Jamieson, one of the four third-round leaders, shot a 1-over 71 and took fourth at minus-11.
The other two co-leaders, Graeme Storm and Gonzalo Fernandez-Castano, both had 3-over 73s on Sunday and tied for fifth with Henrik Stenson, who posted a 69, at 9-under 271.
On the back nine, the tournament came down to Hanson and Larrazabal.
Hanson struggled at 13 when he missed the green, then missed a 10-foot par putt. The bogey dropped him out of the lead and he fell down the leaderboard even more at 14. Hanson's drive landed right of the fairway and his approach sailed left near a bunker. Hanson chipped through the green and made another bogey.
Hanson was one behind Larrazabal, but got a stroke back with a beautiful tee ball to two feet at 15. He tied for the lead, but Larrazabal inched back ahead with a 6-foot birdie putt at the 14th.
The 16th proved to be a crucial hole.
Hanson drove left into the trees and on to a cart path. He got a ruling and mulled over his shot, but the process took almost 15 minutes with Larrazabal anxiously waiting on the tee.
Hanson hit a spectacular second just short of the green. He chipped to two feet and made an unlikely par.
"I had a little bit of a gap between two trees," Hanson said on TV. "If I was going to give myself a chance to win today, I needed to take that shot on, get it up there and make four."
Larrazabal's second at 16 also came up shy of the putting surface. He hit an awkward chip 15 feet short of the flagstick and missed the par putt to fall back into a tie for first with Hanson.
Hanson had a decent look at birdie at 17, but missed. He cashed in at the last and marched on to the winner's circle.
Hanson will be heading to Medinah for the Ryder Cup in two weeks and, like Rory McIlroy, Paul Lawrie, Sergio Garcia and possibly Lee Westwood at the BMW Championship, he's another European with a recent win.
"It's so nice to see so many guys play well from the European side," Hanson said.
NOTES: Hanson became the first Swede to win this title ... Defending champion Simon Dyson had an even-par 70 on Sunday and tied for 46th at even par ... Next week, the European Tour heads to Italy for the BMW Italian Open in Turin, where Robert Rock will defend his title.