Updated

Peter Hanson bogeyed the final hole Sunday, but managed to hang on and win the BMW Masters.

Hanson closed with a 5-under 67 to beat world No. 1 Rory McIlroy by a single stroke. Hanson finished his sixth European Tour title at 21-under-par 267.

"This is by far my biggest win in my career. I think all of the work I have put in to try to be ready for the Ryder Cup and that's really what paid off both in Holland and even now a couple of weeks later," Hanson said.

"I was working really hard all the way from the U.S. PGA (Championship) when I knew that I had a good chance to make the team, with my mind-set of being as prepared as I ever could be for the Ryder Cup."

McIlroy also closed with a 67 to take second at minus-20.

"I'm a little disappointed. I'm very happy with the way I played, but I missed a few opportunities on the front nine, I missed four or five short putts in a row," admitted McIlroy. "I wanted to try to make him work for it. It would have been nice to hole that putt on the last, at least to make him think a little bit, but it wasn't to be and he played well. He deserved it. To go out with the lead and play the way he did and shoot 67 is very impressive."

Luke Donald carded a 6-under 66 to end alone in third at 17-under-par 271, while Ian Poulter was one shot back at minus-16 after closing with a 65.

The victorious European Ryder Cup team had 10 players at Lake Malaren Golf Club this week, and they took the top four spots on the leaderboard, and nine of them finished in the top 15.

Hanson and McIlroy were separated by a stroke entering the final round and no one else got within three of Hanson during the final round.

The Swede birdied the second to push his lead to two. McIlroy stumbled to back-to-back bogeys at four and five to slide four shots off the pace.

McIlroy recovered one stroke with a birdie on the sixth, but Hanson responded with a birdie at the seventh. McIlroy converted a birdie effort at the ninth to make the turn three shots off the pace.

As he has done all week, Hanson caught fire early on the back nine. He ran off three consecutive birdies from the 11th, but his lead only grew by one as McIlroy matched his birdies at 11 and 13.

For the week, Hanson played No. 11-13 at 9-under par with 10 birdies and a bogey.

Hanson birdied the par-5 15th for the fourth straight round, but lost a shot to McIlroy, who eagled the hole to get within three.

McIlroy was two back after he birdied the 16th.

Hanson had parred the final three holes each of the first three rounds, but dropped a shot at the last in the final round to cut his winning margin to a single stroke.

"It was a little bit tense. Rory made a tremendous effort with his eagle on 15 and birdie on 16, so it put quite a bit of pressure on me," Hanson said. "I was trying to play it a little bit safe, but against the world No. 1 you still have to hit the shots."

NOTES: Hanson earned 888,561 euros for the win...He moves to second in the Race to Dubai standings and went over two million euros earned in one season for the first time in his career...The European Tour joins the PGA Tour next week for the final WGC of the year as Martin Kaymer defends his title at the WGC - HSBC Champions.