The Northern Irishman, who broke up with tennis-playing fiancee Caroline Wozniacki a few days ago, finished with a 14-under total of 274 after a remarkable day of ebbing and flowing at the European Tour's flagship event.
Ireland's Shane Lowry carded a 68 to take second place on 275 while Dane Thomas Bjorn, who went into the last round holding a five-stroke lead, ballooned to a 75 and had to be content with a share of third spot alongside twice former winner Luke Donald (70).
On a topsy-turvy day of glorious sunshine during which the swirling winds and tricky pin positions caused the lead to constantly change hands, it was McIlroy who held his nerve the best.
A succession of long putts were holed by the leading players and Donald twice chipped in over the closing stages but the 25-year-old McIlroy ultimately took the tournament by the scruff of the neck with four birdies in the last nine holes.
The victory was McIlroy's sixth on the European Tour and his first on the mainland. He had previously triumphed twice in Dubai, twice in the United States and once in Hong Kong.
The world number 10 ended his campaign in stylish fashion, birdying the par-five 17th and 18th and he threw his ball high into the grandstands after converting a four-foot putt on the final green.
"To win here at Wentworth, at the flagship event, I couldn't have asked for anything more," said McIlroy at the presentation ceremony after pocketing the first prize of £644,411.
"I played well this week and I knew coming here I was playing well because I've had a few top-10s in the States.
"I struggled a bit on Friday," said the 25-year-old in reference to his second-round 71, "but I played great over the weekend."
Twice former major winner McIlroy has never looked upon Wentworth as a happy hunting ground.
The 2011 U.S. Open and 2012 U.S. PGA champion missed the cut three times in his previous six starts and had a best finish of fifth in 2009.
McIlroy began the last day seven shots adrift of Bjorn but went on to equal the biggest final-round comeback in the 60-year history of the BMW PGA Championship.
"I was a little fortunate today because some of the guys ahead of me made some mistakes and I took advantage," he said.
"My caddie set me a target of 15-under to get to. I didn't quite get there but 14-under was enough and I'm happy with that.
"I really wanted to win before the second major of the season," said McIlroy of next month's U.S. Open, "and I couldn't have asked for a better way to prepare."
Lowry was three strokes clear of the field after 12 holes but the 13th proved unlucky for the Irishman as he racked up a double-bogey six.
He then gained some consolation by sinking a monster putt at the 18th.
"I feel very unlucky," said Lowry. "I felt I hit some great shots coming in ... but to hole the putt on the last and to finish second on my own is really nice.
"Rory is definitely one of the best golfers I've ever played with and I've been lucky enough to play a lot of golf with him. He's had his struggles over the last couple of years and I'm delighted for him."
Donald chipped in from the off the green at the 13th and 16th but he and playing partner Bjorn were undone on the front nine where they both slumped to costly double-bogey sevens at the sixth.
World number three Henrik Stenson, who could go top of the rankings depending on incumbent Adam Scott's performance at the Colonial Invitational in Texas later on Sunday, shot a closing 70 to finish tied seventh on 280.
- Sports & Recreation
- Luke Donald
- Caroline Wozniacki
- Thomas Bjorn