McIlroy turned a three-shot deficit into a two-shot lead within the space of five holes in the WGC-Bridgestone Invitational, before Garcia battled back to leave the pair tied heading into the back nine at Firestone Country Club.
Garcia had played the same back nine in just 27 shots in his second round of 61, but it was McIlroy who came out on top two days later in a tense duel, the 25-year-old carding a closing 66 to finish 15 under par.
With Adam Scott finishing outside the top five, that meant McIlroy reclaimed the world number one spot he last held in March 2013, just in time for the final major of the year, next week's US PGA Championship at Valhalla.
After 16 birdies in the first three rounds Garcia could only manage one in a disappointing closing 71 to finish 13 under, meaning the 34-year-old has now won just three times after holding the 54-hole lead on 16 occasions.
"What I am really proud of this week is following on from the Open with a performance like this," McIlroy, only the second European winner of the title after Darren Clarke in 2003, told CBS. "I said straight after I did not want any let down, I wanted to keep going and performing until the end of the season.
"It's great to come to one of my favourite tournaments of the year and to perform like this I am pretty satisfied."
McIlroy pulled his opening drive into the rough but had a gap through the trees and hit a superb low pitch to three feet, while Garcia had to settle for a par by two-putting from long range.
Three-time major winner McIlroy then two-putted from long range on the par-five second for another birdie and also birdied the third to take over the lead as Garcia bogeyed, but that did not tell half the story of an amazing hole.
Garcia's errant drive into the crowd somehow knocked the diamond out of a female spectator's engagement ring and after giving her a signed ball, the Spaniard asked for her contact information after hitting his second shot over the green.
Thankfully, the precious stone was quickly recovered but Garcia was unable to get up and down to save par and McIlroy holed from eight feet for a third straight birdie.
When McIlroy also birdied the fifth from five feet it meant a five-shot swing had taken place in the space of five holes and gave the world number two a two-shot lead.
Garcia desperately needed something to go in his favour and it happened on the eighth, McIlroy driving into the rough and finding a greenside bunker with his approach, from where he failed to get up and down.
Garcia then got back on level terms with a birdie from 15 feet on the ninth, McIlroy missing from just six feet.
That meant the pair went into the back nine tied on 14 under par but it was McIlroy who edged back in front with a birdie on the 11th from eight feet, Garcia then missing from a few inches closer.
The decisive moment then came on the par-three 15th, where Garcia's tee-shot left of the green left him with a near-impossible pitch over a bunker and led to a bogey four.
That gave McIlroy a two-shot lead with three to play and when Garcia failed to convert a birdie chance from 10 feet on the 17th his chance had gone.
Low scoring had been the order of the day on the rain-softened course, five-time major winner Phil Mickelson charging through the field with an eight-under-par 62 which featured 10 birdies and two bogeys.
"I don't know what to say, it kind of came out of nowhere," Mickelson said after finishing five under for the tournament. "The first two rounds really threw me for a loop. I have been struggling getting my short irons close and today they were right on.
"I made a lot of birdies and it was nice. Today was a big day to give me a lot of confidence and momentum heading into the US PGA next week."
What's In Rory's Bag?
: Nike Covert Tour 2.0
Shaft: Mitsubishi Rayon Kuro Kage Silver TiNi 70TX
: Nike VR Forged
(46, 52,56 and 59)
Shafts: Royal Precision Project X 7.0