Italy’s Francesco Molinari finally got his hands on the BMW PGA Championship trophy as Rory McIlroy’s bid for a second title came up short, despite some unexpected late drama.

A closing 68 gave Molinari a 17-under-par total and two-shot winning margin over playing partner McIlroy, with defending champion Alex Noren and Denmark’s Lucas Bjerregaard a shot further back.

Molinari, whose second place 12 months ago was his fifth top-10 at Wentworth in the last six years, began the day in a tie for the lead with McIlroy but quickly moved clear with birdies on the third, fourth and eighth and never looked like being caught until almost making a mess of the 72nd hole.

Three ahead playing the par-five 18th, Molinari’s third shot to the green almost span back into the water and his fourth left him facing five feet for par, with McIlroy 20 feet away for eagle.

However, McIlroy agonisingly left his attempt inches short and Molinari held his nerve to hole out for par, meaning he had dropped just two shots all week, the last coming on the 10th hole of the second round.

The impressive win will take the 35-year-old back inside the world’s top 20 and into the automatic qualifying places ahead of the Ryder Cup at Le Golf National in Paris in September.

“It feels amazing,” Molinari said. “I’ve been close so many times. I think if I could pick one tournament to win in my career it would be this one. To finally get over the line feels amazing and it wasn’t easy. I made it probably more interesting than it should have been.

“Obviously I was hoping Rory wouldn’t make his putt because I wasn’t fancying mine after all that hard work today, but thankfully I holed it anyway.”

Asked about the prospects of a third Ryder Cup appearance at a venue where he has finished runner-up three times in the French Open, Molinari added: “I was too far too back to seriously think about it until this week, but now it’s there and on a course that I love and where I have almost as good a record as I do here. I would love to be there.”

McIlroy had enjoyed a three-shot lead at halfway following rounds of 67 and 65, but struggled to a 71 on Saturday and rescued a 70 on Sunday with birdies on the last two holes.

The 29-year-old had worked on changes to his swing since missing the cut in the Players Championship and said: “I think when you’re working through a bit of a swing change or a swing tweak, it takes more than a week’s work to try to bed it in and this is my first competitive start since trying to rectify things.

“It’s close, it’s very close. I’ve given myself a great chance here this week. I didn’t quite pull it off but it’s not far away. I get a bit down on myself because my expectations are high and with a 36-hole lead I should have closed it out.

“It’s disappointing but that’s not taking anything away from Francesco. He played a great weekend and bogey-free around here is some playing. He deserved the win. I just need to do a little bit more work and I’m looking forward to getting right back at it at Memorial next week.”

Bjerregaard’s closing 65 equalled the lowest score of the week, despite starting with a bogey, while Noren’s 67 ensured he put up a stout defence of the title he won with a course-record 62 in the final round last year.