By Christopher Clarey

New York Times News Service

WIMBLEDON, England — As Novak Djokovic steeled himself again to face Roger Federer and the crowd, Djokovic tried to imagine all the scenarios that could come to pass on Centre Court.

But men’s singles finals at Wimbledon have a way of surpassing everyone’s expectations.

Add Sunday’s tightly wound classic to the list as Djokovic defeated Federer 7-6 (5), 1-6, 7-6 (4), 4-6, 13-12 (3).

It was the fifth Wimbledon title for Djokovic, the defending champion and No. 1 seed. He secured it by saving two match points on the 37-year-old Federer’s serve and then prevailing in the fifth-set tiebreaker at 12-12, the first of its kind in a Wimbledon final.

“I thought most of the match I was on the back foot,” Djokovic said. “I was defending. He was dictating the play. I just tried to fight and find a way when it mattered the most, which is what happened.”

After breaking Djokovic at 7-7 in the fifth, Federer served for the championship at 8-7 and took a 40-15 lead with two consecutive aces. Federer was one point away from winning his ninth Wimbledon singles title and becoming the oldest man to win a major singles title in the Open era.

The majority of the crowd appeared to want that outcome nearly as much as Federer did. Numerous spectators in Centre Court pointed skyward with their index finger in anticipation of that final point.

But Djokovic had other plans.

On the first match point, Federer missed an inside-out forehand after a deep second-serve return. On the second match point, Federer decided to approach the net with a topspin forehand. Djokovic responded by coolly flicking a forehand passing shot winner crosscourt.

It was deuce, and two points later after two Federer forehand errors on the move, Djokovic completed the break of serve and evened the fifth set at 8-8.

Federer’s best chance for victory was gone, even if the final and the tension were far from finished.

Asked later where it went wrong, Federer answered glumly, his baritone voice a little lower than usual.

“One shot I guess,” he said. “Don’t know which one to pick. Your choice.”

It was one of the biggest tennis mood swings imaginable for Federer, who also lost to Kevin Anderson in the quarterfinals of Wimbledon last year after holding a match point.

But beating Djokovic to win Wimbledon at age 37 after having defeated his other greatest rival, Rafael Nadal, in the semifinals, could have been considered the greatest achievement of Federer’s career.

But on the brink of elation, his moment pivoted to deflation.

“I just feel like it’s such an incredible opportunity missed, I can’t believe it,” he said.

“It was kind of a flashback,” he said. “But look, in those kind of moments, I just try to never lose self-belief, just stay calm, just focus on trying to get the ball back, return, which wasn’t serving me very well today.”

The fifth-set tiebreaker was introduced by Wimbledon this year to avoid ultramarathon matches, like the 26-24 fifth set between Anderson and John Isner in the semifinals last year. But this draining and engrossing final was still the longest men’s final in the tournament’s history at 4 hours and 57 minutes. The fifth set alone lasted 2:02.

Djokovic had to fight even longer to defeat Nadal in the 2012 Australian Open final: a five-set match that lasted 5:53. But he said Sunday’s duel with Federer was probably “the most mentally demanding match” of his career.

“I had the most physically demanding match against Nadal in the finals of Australia that went almost six hours,” Djokovic said. “But mentally this was a different level because of everything.”

Federer was the more consistently brilliant and aggressive player overall. He hit 94 winners and made 61 unforced errors. Djokovic finished with 54 winners and 52 unforced errors and struggled with his rhythm in the second set, which he lost in only 25 minutes. He did not break Federer’s serve until the fourth set, nearly three hours into the match.

But what matters most in tennis is winning the most important points. Djokovic is the first man to win a men’s singles final at Wimbledon after saving match point since 1948, when Robert Falkenburg of the United States came back to defeat John Bromwich of Australia after saving three match points.

Federer, who will turn 38 next month, remains a beloved champion worldwide and is having another excellent season. He has won more tour singles matches than any man in 2019.

But Djokovic continues to have his number. Sunday’s victory was his fifth straight over Federer and also his fifth straight in Grand Slam play. The last time Federer defeated Djokovic in one of the four major tournaments was in the semifinals of Wimbledon in 2012.

Since then, Djokovic has been able to resist Federer’s quick-strike skills and defeat him in three Wimbledon finals: 2014, 2015 and now 2019.