Rory McIlroy did everything he thought he needed to win the HSBC Champions, and then Xander Schauffele made him do a little more.

McIlroy delivered all the right shots in a playoff Sunday, hitting 4-iron to 25 feet for a two-putt birdie to beat Schauffele and win for the fourth time this year. It was McIlroy's third World Golf Championships title, and first since the Match Play in 2015.

McIlroy played bogey-free on the weekend and closed with a 4-under 68. Schauffele, battling the flu all week, birdied the par-5 18th for a 66 to force a playoff in his bid to become the first repeat winner of the HSBC Champions.

Rory McIlroy of Northern Ireland tees off on the final day of the HSBC Champions golf tournament at the Sheshan International Golf Club in Shanghai on Sunday, Nov. 3, 2019. (AP PhotoNg Han Guan)

Rory McIlroy of Northern Ireland tees off on the final day of the HSBC Champions golf tournament at the Sheshan International Golf Club in Shanghai on Sunday, Nov. 3, 2019. (AP PhotoNg Han Guan)

But his tee shot went left on the 18th in the playoff, in thick rough next to a bunker. He had to lay up, and he missed a 12-foot birdie putt.

More AP golf: https://apnews.com/apf-Golf and https://twitter.com/AP_Sports

Rory McIlroy of Northern Ireland tries to get past fans on the final day of the HSBC Champions golf tournament held at the Sheshan International Golf Club in Shanghai on Sunday, Nov. 3, 2019. (AP PhotoNg Han Guan)

Rory McIlroy of Northern Ireland tries to get past fans on the final day of the HSBC Champions golf tournament held at the Sheshan International Golf Club in Shanghai on Sunday, Nov. 3, 2019. (AP PhotoNg Han Guan)

Xander Schauffele of the United States tees off on the final day of the HSBC Champions golf tournament at the Sheshan International Golf Club in Shanghai on Sunday, Nov. 3, 2019. (AP PhotoNg Han Guan)

Xander Schauffele of the United States tees off on the final day of the HSBC Champions golf tournament at the Sheshan International Golf Club in Shanghai on Sunday, Nov. 3, 2019. (AP PhotoNg Han Guan)

Rory McIlroy of Northern Ireland walks on the fairway during day three of the HSBC Champions golf tournament held at the Sheshan International Golf Club in Shanghai on Saturday, Nov. 2, 2019. McIlroy spun a wedge down to 3 feet for birdie on his final hole for a clean card at a 5-under 67, giving him a one-shot lead over Louis Oosthuizen on a Saturday of big runs and ugly collapses. (AP PhotoNg Han Guan)

Rory McIlroy of Northern Ireland walks on the fairway during day three of the HSBC Champions golf tournament held at the Sheshan International Golf Club in Shanghai on Saturday, Nov. 2, 2019. McIlroy spun a wedge down to 3 feet for birdie on his final hole for a clean card at a 5-under 67, giving him a one-shot lead over Louis Oosthuizen on a Saturday of big runs and ugly collapses. (AP PhotoNg Han Guan)