World No 1 Novak Djokovic ended Roger Federer’s dream of winning a record-breaking eighth Wimbledon title with a four-set win to seal his third crown at the All England Club.

A packed Centre Court witnessed the world’s top two players battle for glory for nearly three hours in a match that lived up to its billing. Federer was aiming to add to his incredible haul of seven Wimbledon titles but couldn’t match defending champion Djokovic’s resilience with the Serb eventually winning 7-6 (7-1) 6-7 (10-12) 6-4 6-3.

“It’s a big challenge playing against Roger. A lot of players of my generation have looked up to him and followed his lead,” said Djokovic who now has the same number of Wimbledon titles as coach Boris Becker who won his first 30 years ago.

“I knew coming on the court that Roger is going to play like he always plays, at his best when it matters the most. He makes you work hard every single point.”

With the majority of the Centre Court crowd supporting 17-time Grand Slam champion Federer, the pressure was on the top seed and defending champion Djokovic to show his mettle.

The 28-year-old got over the disappointment of squandering seven set points in a gripping second set to wreck Federer’s dreams of a record eighth Wimbledon trophy and 18th grand slam title.

Instead the plaudits belonged to Djokovic as he displayed his determination to win a ninth major by stretching and sliding after the ball to all corners of the court to douse second-seeded Federer’s firepower.

He closed out the match to become first man since 2007 to retain the Wimbledon men’s title and in the process took his Grand Slam tally to nine. It was a cathartic moment for Djokovic just a month after his heartbreaking French Open final defeat against Stan Wawrinka – a loss that denied him the only major title he has yet to win.

For 33-year-old Federer, it was a bitterly disappointing end to his bid to become the oldest Wimbledon champion of the Open Era. The 17-time major winner has now gone three years since his last Grand Slam triumph, but he had his chances.

In a rollercoaster rematch of last year’s final, he the former world No 1 moved 4-2 up in the first set and the squandered two set points. Federer then saved seven set points in the second set before bravely levelling the contest.

However, Djokovic stepped on the gas and raced away to the title. Sunday’s final was the pair’s 40th career meeting and 12th in the Grand Slams. Federer had his opportunities but he could only convert one of seven break points in the match and as he pressed, he committed 35 unforced errors to Djokovic’s 16.

“Novak played not only good today but the whole two weeks, the whole year, last year and the year before that,” said Federer.

“I had my chances in the first set. I got lucky to win the second, had chances in the third.

“But he was better on the bigger points. He was rock solid, I didn’t play badly myself. That’s how it goes.”