WIMBLEDON, England — Roger Federer defeated Rafael Nadal in a Wimbledon men's semifinal Friday to reach his 12th final at this storied event.

In a match marked by long rallies from the baseline, Federer won 7-6 (3), 1-6, 6-3, 6-4, pumping his arms triumphantly as Nadal's final shot sailed long.

"I'm exhausted," Federer said. "It was tough at the end. Rafa played unbelievable shots to stay in the match .... Always with Rafa it's very special.

"I had spells where I was serving really well, and the biggest points in the match went my way."

Although Federer-Nadal is one of the greatest rivalries in sports, the two had not played each other at Wimbledon in 11 years, since their epic final in 2008, which many people believe is the greatest match in the history of the sport.

Federer will play Sunday against top-seeded Novak Djokovic, a five-time Wimbledon winner who defeated Roberto Bautista Agut to advance.

Federer, who improved to 12-1 in Wimbledon semifinals, has achieved his 31st Grand Slam final and has extended his lead atop the all-time list for most finals appearances in men's singles for a Grand Slam tournament.

Federer has attained his most Grand Slam success at Wimbledon in terms of titles won (eight), matches won (101) and finals reached (13).

He's bidding to become the second player in history to win nine singles titles. Martina Navratilova is the only person to have achieved that milestone, winning nine singles titles between 1976 and 1986.

What's more, at 37 years, 340 days, Federer aims to become the first man in the Open era to win five Grand Slam titles after turning 30. He's currently tied with Rod Laver, Ken Rosewall, and Nadal, all of whom have four.

This was the 40th meeting between Federer and Nadal, with Nadal still having an overall advantage of 24-16. However, Federer has won six of the past seven and leads on grass 3-1, with all of the previous three meetings taking place in the Wimbledon finals, in 2006, '07 and '08.

Djokovic defeated Bautista Agut 6-2, 4-6, 6-3, 6-2, leaving him one step from completing his bid to defend his tournament title.

Djokovic was facing a formidable opponent, one who had beaten him in two previous meetings this year. However, Djokovic had a far easier path to the finals than Federer or Nadal.

"I had to dig deep," Djokovic said. "Regardless of that, (Bautista Agut) was not overwhelmed by the stadium or the occasion. He played really well.

"I got a bit tight, and it was a very close opening four or five games of the third set. That's where the match could have gone different ways, and I'm glad it went my way."

For the second consecutive year, all four of the men's semifinalists were 30 or older, and this year's quartet set the Grand Slam record for the oldest combined age of men's singles semifinalists in the Open era (134 years).

This will be the 22nd time a Grand Slam final features a showdown between two members for the so-called Big Three — Federer, Nadal and Djokovic.