McIlroy carded a one-under 71 for 17-under 271 on the Royal Liverpool links course to win by two shots from Sergio Garcia of Spain and Rickie Fowler of the United States.
Garcia made a brave bid to win his first major with a finishing six-under 66 and closed to within two shots going into the back nine — but could get no closer.
The 25-year-old McIlroy has now won three of the four major crowns in golf, with only the U.S. Masters to elude him.
He entered the final round with a six-shot lead but it was slowly whittled away as he made back to back bogeys on the fifth and sixth.
A birdie on the par-three 9th steadied his nerves and he breathed even easier when Garcia took two shots to get out of a bunker on the 15th.
McIlroy played the last with a three-shot lead and could afford to play safe for a par-five before celebrating with his mother and father, overcome with emotion.
He had won after leading from the start to finish, only the 10th man in British Open history to achieve that feat.
By contrast, former world number one Tiger Woods closed the tournament on six-over-par and in 69th, his worst ever finish at the oldest major.