WIMBLEDON, England — After waiting 11 years to get another shot against Rafael Nadal at Wimbledon, Roger Federer was so, so close to the finish line.

One match point slipped away when Federer missed a forehand return. A second came and went on a backhand return. Later, serving for a spot in a record 12th final at the All England Club, Federer shanked a leaping overhead off the top edge of his racket frame, giving Nadal a break point. After Nadal wasted that chance, Federer earned two more match points — and failed to convert those, either, as his wife, Mirka, peeked through the fingers covering her face.

Federer knew it wouldn't be easy against his great rival. Never is, really, no matter where they play. Eventually, Nadal pushed a backhand long on match point No. 5, bringing an anticlimactic close to the otherwise classic contest and allowing Federer to win their semifinal 7-6 (3), 1-6, 6-3, 6-4 on Friday.

"I'm exhausted. It was tough at the end," Federer said. "I'm just very relieved it's all over."

Federer closed in on a ninth championship at the All England Club and 21st Grand Slam trophy in all. To get to those numbers in Sunday's final, Federer must get past Novak Djokovic, who is the defending champion and seeded No. 1.

"We all know how good he is anywhere," Djokovic said about Federer, "but especially here."

Djokovic isn't too shabby himself. He reached his sixth final at the grass-court major by beating 23rd-seeded Roberto Bautista Agut 6-2, 4-6, 6-3, 6-2 earlier Friday. Djokovic is eyeing a fifth championship at Wimbledon and 16th major title.

As entertaining as that first semifinal was — including a 45-stroke point won by Djokovic — it was merely a tasty appetizer ahead of the day's delectable main course.

Not only was this the 40th installment of Federer vs. Nadal, but it also was their first meeting at Wimbledon since the 2008 final. In a match many consider the best in the sport's lengthy annals, Nadal edged Federer 9-7 in a fifth set that ended after 9 p.m., as any trace of daylight disappeared.

How excited, then, were the spectators for the rematch? When Federer and Nadal strode out into the sunshine at 4:30 p.m. Friday, they were welcomed by a standing ovation before ever swinging a racket.

Quickly, that greeting was justified. These are, of course, two of the greats of all-time — maybe the two greatest — and they lived up to that status for stretches.

One key, for Federer, was that his rebuilt backhand, hit strong and flat more frequently than it used to be, held steady against Nadal's bullwhip of a lefty forehand. Another was that Federer was able to withstand Nadal's serve, which has improved a ton over the years. Federer amassed 10 break points, and though he succeeded on just two, that was enough, with the last, vital conversion making it 2-1 in the fourth set. And then there was this: Federer won 25 of the 33 points when he went to the net.

"I didn't play well enough," said Nadal, who lost a five-set semifinal to Djokovic a year ago at Wimbledon.

There was something of an "Anything you can do, I can do, too" vibe to Friday's proceedings. Federer would kick up chalk with an ace to a corner, and Nadal would do the same in the next game. When Nadal jumped out to a 3-2 lead in the first-set tiebreaker, Federer used sublime returning to reel off five points in a row to claim it.

Who else but Federer could strike a serve so well that Nadal's wild reply would be caught by someone in the Royal Box behind him, as happened early in the second set? Who else but Nadal could attack Federer's generally unassailable forehand in such a manner as to draw one so off the mark that it landed in the third row?

"I thought probably the biggest points in the match went my way. There were some tight ones and long rallies," Federer said. "He plays with such velocity and spins and everything, you're not always sure you're going to connect the right way."

No one ever has managed to reduce Federer to mid-match mediocrity quite the way Nadal can, part of why the Spaniard entered Friday with a 24-15 overall lead head-to-head, including 10-3 at Grand Slam tournaments.

This was the second major in a row where they've faced off: Nadal won their windy French Open semifinal last month en route to his 12th championship on the red clay and 18th Slam overall. But Wimbledon is Federer's dominion: He's won 101 matches at the place — more than any other man at any other Slam, even Nadal at Roland Garros — and all of those trophies.

Djokovic, meanwhile, leads his series with Federer 25-22, including 9-6 in Grand Slam matches.

"I hope I can push him to the brink and hopefully beat him. But it's going to be very difficult, as we know," Federer said. "He's not No. 1 just by chance."

On Friday, Djokovic was as animated as ever. When Bautista Agut's shot hit the net tape, popped in the air and slid over for a winner that tied their semifinal at a set apiece, Djokovic motioned to the roaring fans, sarcastically encouraging folks to get louder. When Djokovic ended that 45-stroke point — the longest on record at Wimbledon, where such stats date to 2005 — with a backhand winner, he cupped his ear while glaring into the stands.

"I had," Djokovic said, "to dig deep."

Even Bautista Agut didn't really expect his visit to the All England Club to last this long: The Spaniard was supposed to meet a half-dozen of his buddies on the island of Ibiza this weekend for his bachelor party. Instead, those pals were sitting in a guest box at Centre Court on Friday.

Eventually, Djokovic took control with his enviable ability to return serves, track down balls and go from defence to offence.

Now he's Federer's problem.

___

This version of the story corrects that Wimbledon's longest point statistics date to 2005.

___

More AP tennis coverage: https://www.apnews.com/apf-Tennis and https://twitter.com/AP_Sports

Djokovic for the title on Sunday.

Federer's serve served him well against his Spanish rival, who won their last meeting at Wimbledon in the 2008 final — taking the epic fifth set 9-7 as darkness descended. The Swiss great finished with 14 aces this time and landed 69% of his first serves.

Federer won his record eighth Wimbledon title in 2017, but lost to Djokovic in the final in both 2014 and 2015.