When the final word is written about Roger Federer’s career, it will surely be “grace” — the one word that conveys the seeming effortlessness of the Swiss champion’s game.

Sunday at Wimbledon, it was grit and raw aggression that defined Federer as he battled top-seeded Novak Djokovic, five years his junior, over a five-set men’s final of exceptional quality, razor-thin margins and multiple shifts of momentum.

But neither Federer’s bold tactics nor 75 winners were enough against a Serb who bent plenty of times — failing to convert his first match-point, surrendering five successive games and twice calling for medical attention — but refused to break.

Djokovic weathered all Federer fired his way and produced his best serves when he needed them most to win his second Wimbledon championship, and the seventh major of his career, 6-7 (9-7), 6-4, 7-6 (7-4), 5-7, 6-4.

In doing so, Djokovic, 27, reclaimed the No. 1 ranking he had ceded to Rafael Nadal last September. And he denied Federer what would have been a record eighth men’s Wimbledon title.

Djokovic, who had fallen short the last three times he reached a Grand Slam final, dropped to his knees on a threadbare Centre Court, plucked a blade of grass and feasted on it, just as he had when he won Wimbledon in 2011.

“The best meal I ever had in my life,” said Djokovic, who called it a victory not just over Federer, whose 131-19 record on grass is without peer, but also against himself, for maintaining his belief after squandering so many chances to win it in four sets.

It was their 35th meeting but only their second on grass — a reprise of the 2012 Wimbledon semifinal that Federer won in four sets.

And while Djokovic was favored Sunday, Federer, a father of four on the cusp of 33, seems to defy age and gravity at Wimbledon, where he won the first of his 17 majors in 2003, his balletic movement, backhand slice and pinpoint serves tailored to the surface.

Djokovic walked out to Centre Court first, as protocol dictates of the higher seed. The split-second lag in Federer’s arrival only gave the crowd a chance to makes its loyalties known from the outset.

The Swiss, playing in his ninth Wimbledon final, was showered in applause by an unabashedly partisan crowd that included Prince William and wife Kate, who looked on from the Royal Box with soccer icon David Beckham and former Wimbledon champions Neale Fraser, Rod Laver, Roy Emerson, Manuel Santana, Stan Smith and Jan Kodes.

Little separated the two in an expertly played opening set. Neither managed as much as a single break point as they pounded away at each other’s backhand, hoping to expose a weakness. So a tiebreak settled it, in which Federer fended off two set points before coaxing an error from the Serb.

Federer had lost his serve just once all tournament. Djokovic doubled that mark early in the second set and held firm to level the match at one set apiece.

Neither dropped his level of play or showed the slightest fatigue or impatience through a tight third set. Again, a tiebreak was required. And Federer stayed on the attack, fully aware of Djokovic’s tireless retrieval skills and dangerous passing shots. With a backhand pass down the line, the Serb notched the first mini-break and soon led two sets to one.

Broken early in the fourth set, Federer quickly found himself one game from defeat, trailing 2-5. Rather than wilt, he let his serves rip (finishing with 29 aces to Djokovic’s 13) and charged the net. Facing match point, he blasted a serve that was initially called out but reversed once replay showed it had nicked the line.

Federer won five consecutive games to claim the fourth set and force the first five-set Wimbledon final since 2009, when he beat American Andy Roddick, 16-14, in the fifth.

This time, however, Federer served second, which meant he was playing from behind.

Leading 2-1, Djokovic summoned the trainer to knead out his right calf. Unperturbed by the pause, Federer replied with a love-hold to knot it at 2 and then fought off three break points to hold at 4-4, flashing a clenched fist of resolve.

Though nearly four hours in the making, Djokovic’s victory came quickly, with Federer erring one too many times on his backhand.

They met at the net and embraced warmly, then lauded each other in their post-match remarks.

“I can only say, ‘Congratulations,’” Federer said, as Djokovic cradled the trophy that the Swiss had cradled seven times before. “Amazing match. Amazing tournament and deserved. Well deserved.”

And Djokovic — before thanking his fiancee, his parents and all the coaches who had shaped his game — paid homage to Federer. “I respect your career and everything you have done,” the Serb said.

The Centre Court crowd clearly shared the sentiment, honoring both with an extended ovation. The Duke and Duchess of Cambridge were first to comfort Federer after he stepped off the court.

Amid Djokovic’s triumph, a sadness seemed to linger in the air, as if all assembled knew they had just witnessed Federer’s final assault on the Wimbledon Championships.

Federer, however, wasn’t so sure.

“You don’t know,” he said. “That’s the disappointment of an Olympic result, of a World Cup result, Wimbledon result — whatever it is. You’ve just got to wait and see. There is no guarantee that you’re going to ever be there again or not.

“Or maybe, there’s much more to come.”