Published: Oct 30, 2011 8:59 AM EDT
Updated: Oct 31, 2011 6:30 AM EDT

SHANGHAI (AP) - U.S. Open champion Rory McIlroy defeated Anthony Kim of the United States in a sudden-death playoff Sunday to win the Shanghai Masters.

McIlroy gave up an early three-shot lead before rallying from a stroke down on the back nine to finish regulation level with Kim at 18-under 270 and force the playoff.

The 22-year-old Northern Irishman had a chance to win the championship with an 8-foot birdie putt on the 18th at Lake Malaren's Jack Nicklaus-designed Masters course, but missed by inches.

Both players drove into the bunker on the first playoff hole, then both made equally well-placed shots out of the sand close to the pin. The American missed his putt from about 3 feet, while McIlroy sank his 2-footer. It was the first time he's won in three career playoffs.

McIlroy captured the $2 million first-place prize money, the richest in golf, while Kim took home $750,000. Thirty players took part in the invitational, first-year tournament, which isn't sanctioned by a major tour.

"It's something that I feel like I can still get better at is winning and putting yourself in the position to win when you're not playing your best," McIlroy said.

"Even if it's scrappy golf where you grind it out, you're going to win a lot more tournaments by doing that rather than playing your best golf the whole week. I was very happy I was able to pull this one out."

American Hunter Mahan (70) and South Korea's Noh Seung-yul (73) finished joint third at 13-under.

Lee Westwood hit a hole in one on the 12th hole and seven birdies for a 67, finishing in fifth place at 12-under. It was the best round of the week for the second-ranked Englishman, despite the fact he ended with two bogeys.

The final round turned into an unexpected duel between third-ranked McIlroy and the 82nd-ranked Kim, who has just three PGA tour victories to his credit.

There were echoes of McIlroy's stunning collapse at the Masters earlier this year when he sprayed shots all over the course and surrendered a four-shot lead in the final round at Augusta on his way to an 80.

After three rounds of relatively mistake-free golf in Shanghai, McIlroy hit into the water and bunkers, and missed several close putts. But this time, he was able to turn it around.

His troubles started on the first hole when he hit the pin with his approach shot, causing the ball to bounce back into the fringe and leading to a bogey. Kim was able to quickly make up the difference, sinking three birdies to pull into a share of the lead at 18-under on the sixth hole.

"I felt good standing on the first tee obviously with a three-shot lead," McIlroy said. "I thought my second shot was very good. It was just a little unfortunate to hit the pin and ricochet back off the green. To go from three ahead to one ahead after the first hole was obviously not the start I was looking for."

After McIlroy answered with a birdie to retake the lead on No. 7, he hit his second shot into the water on the difficult par-4 No. 9, settling for a bogey and giving Kim another opening.

The American missed an easy putt from 5 feet to take bogey himself and remain one shot back at the turn.

McIlroy's struggles continued on the back nine. The Northern Irishman hit into the bunker on the 11th and then three-putted for another bogey - his third of the day - to give Kim sole possession of the lead at 18-under.

After hitting into the bunker again and barely salvaging par on the 14th, McIlroy finally got a break on the 15th hole when he made a 5-footer for birdie and Kim missed from the same distance to even the score again.

McIlroy had a chance to take the lead on the 17th, but just missed his birdie putt. Then, on the final hole, he missed the putt that would have given him the victory.

"It was an exciting final day and a tough finish for me personally," Kim said. "We had a lot fun out there today."

Ian Poulter (72) finished in sixth place at 11-under, while Retief Goosen (68) and K.J. Choi (67) were in joint seventh at 8 under. Y.E. Yang (72), Padraig Harrington (72) and John Daly (71) followed at 6 under.

All the top players received appearance money and last place paid $25,000. There were no ranking points at stake because the event isn't sanctioned by a major tour.

The World Golf Championships-HSBC Champions will take place next week at nearby Sheshan International.