Andy Murray’s bid to win Wimbledon was ended by Roger Federer as the Swiss claimed a record-equalling seventh SW19 triumph and 17th Grand Slam title.

Murray, 25, was aiming to become the first British man since Fred Perry in 1936 to lift a major trophy.

But 30-year-old Federer won 4-6 7-5 6-3 6-4 on Centre Court to match the mark set by Pete Sampras and reclaim the world number one ranking.

A tearful Murray has now lost all four of his Grand Slam finals.

He was the first Briton to contest the Wimbledon men’s singles final since Bunny Austin in 1938, but fell just short of the ultimate goal.

Federer fully deserved his victory, which not only sees him level Sampras on seven titles but also a record 286 weeks as world number one.

He is the second-oldest man to occupy top spot and will go to the Olympics – also being staged at the All England Club – as clear favourite.

Murray, who collects the £575,000 runner-up prize, joins his coach Ivan Lendl as the only men in the Open Era to lose their first four Grand Slam finals.

Having made poor starts in each of the previous three – all of which finished in three-set defeats – Murray knew it was vital to secure the early momentum.

All was going to plan as a couple of pummelling backhands down the line, a tactic many highlighted pre-match, helped Murray break in the opening game and then consolidate the advantage for a 2-0 lead.

Federer looked uneasy with the pace his opponent was setting and began deploying the sliced his groundstrokes to slow things down.

A majestic backhand landed on the baseline to engineer a break-back point in game four, and he converted it when Murray found the net.

Both men needed to serve their way out of trouble as the pressure mounted and, crucially, Murray produced a sensational volley at his feet to save the second of two break points in a 13-minute game eight.

He then struck with the help of a forehand pass that Federer ducked to avoid being hit – reminiscent of the aggression shown by Lendl during his own career – and comfortably served out the first set.

Statistically, Murray actually improved in almost every area during the second, but the key difference was he could not take his chances.

Whereas the 25-year-old converted both breaks points that came his way in the first set, he let two slip at 2-2 and another two at 4-4.

Federer held for 6-5 before going on the attack, and he came from 40-15 down to level the match with a sensational backhand drop volley.

Heavy rain arrived at at 16:14 BST with Federer 40-0 up in game three of set three, and the prospect of further downpours saw the roof closed.

When play resumed 35 minutes later the Swiss, who destroyed world number one Novak Djokovic indoors on Friday, was vastly superior and put Murray under the cosh in a marathon game five.

Murray was reeled in from 40-0, Federer moving to deuce when the Scot took a heavy tumble at the net, and he slipped again before finally succumbing on a sixth break point.