Northern Ireland's US Open champion drew level with a birdie at the long 15th, however, and with pars at the final three holes they tied on the 18-under-par mark of 270, McIlroy going round in a level-par 72 to Kim's 69.

At the first extra hole Kim missed a three-foot putt and McIlroy's two-footer for par gave him the title.

South Korean Noh Seung-yul and American Hunter Mahan were five strokes back in joint third, England's world number two Lee Westwood missing the chance to join them by bogeying the last two holes after he had holed-in-one at the 12th.

Nervy finish: McIlroy threw away a three-shot lead but beat Kim in the play-off

Shanghai Masters leaderboard

McIlroy's win does not improve his world ranking position or boost his Ryder Cup points because the tournament did not have official tour status.

He was able to breathe a sigh of relief, though, after going in the water on the ninth, three-putting the 11th and missing an eight-foot chance to win on the final green, then finding a bunker like Kim when they went into sudden death.

It was his fourth victory as a professional and his second of the year following his eight-shot triumph at the US Open in June.

McIlroy said: 'I felt that I was playing good golf even though the pin positions were a bit more challenging.

'Even when Anthony was level and then went ahead I kept telling myself there was only one shot in it and to keep playing the same way.

'After four play-offs maybe I am getting a bit better at this, but I did have a better lie than Anthony.

'My goal is to keep improving and learning ways to win tournaments and for me this kind of concentration is important.'