Rory McIlroy held off a spirited challenge from Ryder Cup teammate Sergio Garcia to claim his third major title on a thrilling final day of the Open Championship at Royal Liverpool.

McIlroy took a six-shot lead over Rickie Fowler into the last round and was seven clear of Garcia, but saw that advantage cut to just two strokes as Garcia played the first 10 holes in five under par.

However, the 34-year-old Spaniard - fifth here in 2006 and now with 19 top-10s in 64 majors - crucially bogeyed the 15th to release some of the pressure and McIlroy would not be denied becoming the first European player to win three different majors since the Masters was founded in 1934. Even greats such as Nick Faldo and Seve Ballesteros won just two of the four.

McIlroy's closing 71 gave him a 17-under-par total of 271, two ahead of a gallant Garcia whose closing 66 left him joint second with Rickie Fowler. Fowler birdied three of the last four holes to card a 67 and has now finished fifth, second and second in the year's majors.

The Northern Irishman becomes just the third man in the modern era after Tiger Woods and Jack Nicklaus to win three majors by the age of 25, while the first prize of £975,000 was not the only windfall for the McIlroy family - his father Gerry and three friends each won £50,000 after putting £100 on the 15-year-old at 500-1 a decade ago to lift the Claret Jug before his 26th birthday.

Hampshire’s Justin Rose finished tied 23rd after a one-under final round of 71.

Back up to second in the world rankings, McIlroy has completed three legs of the career Grand Slam and needs to win the Masters to join Gene Sarazen, Ben Hogan, Gary Player, Jack Nicklaus and Tiger Woods as the only men to have won all four majors. He led by four shots going into the final round at Augusta in 2011 only to collapse to a closing 80.

McIlroy is the second wire-to-wire winner of a major in succession after Martin Kaymer won the US Open at Pinehurst last month by eight shots, the same margin by which McIlroy won the 2011 US Open and 2012 US PGA Championship.

A similar procession was expected in some quarters on Sunday, not least when McIlroy got off to a flying start by smashing a drive down the middle of the first fairway and holing from 20 feet for birdie to extend his lead to seven shots.

However, the benign conditions were allowing the chasing pack to make a charge and it was Garcia who took most advantage, birdies on the first, third and fifth taking him to the turn in 32.

McIlroy had carded consecutive bogeys for the first time all week on the fifth and sixth and had to save par from a greenside bunker on the seventh, but also birdied the ninth to restore a four-shot cushion.

That lasted a matter of minutes though, Garcia holing from 12 feet for an eagle on the 10th to reduce the gap to just two shots, only for McIlroy to respond with a two-putt birdie on the same hole 10 minutes later.

It was Garcia's turn to feel the pressure as he carved his approach to the 12th into the grandstand, but he was smiling seconds later as the ball rebounded out and on to the edge of the green. From there he saved par, kissed the ball and deposited it straight back into the same grandstand - albeit at a considerably slower speed than the first time.

McIlroy agonisingly left a birdie putt inches short on the same hole before hitting a dreadful tee shot on the 13th which came up well short of the green, the resulting bogey cutting his lead to two shots again.

Then came the defining moment. With McIlroy watching back on the tee, Garcia failed to get out of a greenside bunker on the 15th at the first attempt and although he birdied the 16th, so did McIlroy and when Garcia left a birdie attempt on the 17th tamely short, it was effectively all over.