SHANGHAI, Oct 28, 2012 (AFP) - When world number one McIlroy, who had started uncharacteristically slowly on Sunday, eagled the 15th and followed with a birdie at 16 to pull within two strokes it seemed the Swede might wobble.
But superb up-and-downs from a bunker on 15, the rough at 16 and another bunker on the treacherous short 17th kept McIlroy at bay and enabled Hanson to pocket a winner's cheque of $1.16 million despite dropping his only shot of the day at the final hole.
Earlier the Swede, who was the only man on the victorious European team to draw a Ryder Cup blank four weeks ago, got off to the ideal start when he birdied the short par-four second to move to 17 under while playing partner McIlroy dropped shots at the fourth and the fifth.
Hanson, who had the led the 23-year-old Northern Irishman by a single stroke overnight, had suddenly stretched it to four strokes inside five holes.
On a morning when the air was heavy with pollution and the US Consulate in Shanghai's air quality index was hovering between the highest warning level of "hazardous" and the next worst "very unhealthy", McIlroy, who complained of headaches after his 67 on Thursday because of the lack of clean air, seemed to be feeling the effects again early on as he slid back to 13 under.
He birdied the next to bounce back but had to wait until the ninth to get back to 15 under.
Meanwhile Ryder Cup talisman Ian Poulter started his day in scorching fashion, picking up three strokes in his first seven holes to catapult up the standings to 12 under par.
After the turn the flamboyant Englishman, who won four points out of four for Team Europe at Medinah a month ago, also birdies 10, 11 and 13 join McIlroy on 15 under within three of Hanson who made a further gain against par at the seventh.
McIlroy and Hanson matched each other with birdies at the 11th. Hanson's three was followed up with a superb tee shot at the short 12th for another birdie and a lead of four shots with six to play.
By now Hanson was seemingly unstoppable and the par-five 13th yielded his third birdie in a row and the 27th of an amazing week as he hit 21-under par. McIlroy also holed for a birdie but was four behind.
Poulter, with holes running out was determined to keep on the leaders' coat-tails and reached 16 under when he sank another birdie putt on the par-five 15th but after a superb approach to 16 he could not make the 10-footer and parred in for a seven-under round of 65 for fourth place.
McIlroy showed he was not finished, however, by rolling in a 25-foot putt for eagle via the left lip at 15 to move to 19 under. But the ice-cool Swede splashed out of a greenside bunker to two feet and tapped in another birdie.
He again showed nerves of steel at the next after putting his approach into rough behind the green. With McIlroy five feet away for birdie, Hanson pitched his ball to within a foot to avoid the possibility of a two-shot swing as McIlroy duly sank the putt to get to 20 under, two behind with two to play.
Hanson kept the gap intact by holing a 15-foot putt for par at the 17th. He again missed the green at 18 and this time failed to get up and down. But McIlroy agonisingly missed the 20-foot putt from the back fringe which would have taken the tournament to a play-off.
Luke Donald was third on 17-under after a 66, meaning Ryder Cup stars filled the first four places on the leaderboard.
Leading scores on Sunday after the fourth and final round of the $7 million BMW Masters at Lake Malaren Golf Club, Shanghai:
(Par 72, 6,706 yards)
267 - Peter Hanson (SWE) 66-64-70-67
268 - Rory McIlroy (NIR) 67-65-69-67
271 - Luke Donald (ENG) 70-67-68-66
272 - Ian Poulter (ENG) 70-69-68-65
273 - Shane Lowry (IRE) 72-64-69-68
274 - Louis Oosthuizen (RSA) 68-69-69-68, Paul Casey (ENG) 70-68-68-68, Justin Rose (ENG) 68-68-69-69, Alexander Noren (SWE) 68-68-69-69, George Coetzee (RSA) 69-68-66-71
275 - Martin Kaymer (GER) 68-69-69-69, Graeme McDowell (NIR) 69-71-66-69, Michael Hoey (NIR) 67-70-68-70
276 - Lee Westwood (ENG) 70-69-71-66, Nicolas Colsaerts (BEL) 69-68-69-70
277 Oliver Fisher (ENG) 74-67-70-66, Jamie Donaldson (WAL) 62-74-72-69, Thongchai Jaidee (THA) 70-72-65-70, Charl Schwartzel (RSA) 69-68-68-72
278 - Robert Karlsson (SWE) 71-64-75-68, Liang Wenchong (CHN) 69-69-72-68, David Lynn (ENG) 69-68-72-69, Soren Kjeldsen (DEN) 72-66-70-70, Ross Fisher (ENG) 69-69-68-72