SHANGHAI, China -- Peter Hanson of Sweden won the BMW Masters on Sunday for his second European Tour victory of the year, shooting a 5-under 67 to hold off Ryder Cup teammate Rory McIlroy by a stroke.

Hanson finished at 21-under 267 on The Masters Course at Lake Malaren and earned $1,166,600 in the European Tour's richest regular event. He won the KLM Open last month in the Netherlands and has six career tour victories.

BMW MASTERS

This is the second year of the BMW Masters in Shanghai, and the first in which it is an official event on the European Tour.

The top-ranked McIlroy, the winner last year when the event was a non-sanctioned exhibition tournament, finished with a 67.

Third-ranked Luke Donald was third at 17 under after a 66, and fellow Englishman Ian Poulter completed a sweep of the top four spots by European Ryder Cup players, closing with a 65 to finish at 16 under.

McIlroy, who began the final round one shot behind Hanson, fell four shots behind after five holes.

However the double major winner regrouped with four birdies over his next eight holes before eagling the par-five 15th. McIlroy then closed to within two when he holed a 25-footer for birdie at the par-3 16th.

Despite a bogey at the last, Hanson held on for the victory and the richest prize of his career.

"It's fantastic to win the BMW Masters, and to go head-to-head with the world No. 1 is always nice but, to come out on top, it feels great," Hanson said. "This is by far my biggest win so it feels great, as we had just so many guys in the top 10 in the world so this trophy is very, very special to me."

McIlroy was chasing his fifth victory of the season, but has had to settle for a ninth second-place finish on the European Tour.

"I didn't get the best of starts, but it started coming together over the back nine and that's what I wanted Peter to do, and that's have to try and make him work for it," said McIlroy. "But he played well and deserved his win. To go out there with the lead and play the way he did and shoot 67 is very impressive, so he was always going to be tough to beat."