WIMBLEDON, England — The most celebrated rivalry in modern men’s tennis is becoming a habit again.

After nearly two years of not playing each other, Roger Federer and Rafael Nadal will meet for the second time in five weeks when they face off Friday in the Wimbledon semifinals.

Federer finished his quarterfinal first on Wednesday, rallying to defeat Kei Nishikori, 4-6, 6-1, 6-4, 6-4, on Centre Court. Nadal joined him soon after, defusing the big serve of the American Sam Querrey to win, 7-5, 6-2, 6-2, on No. 1 Court.

Friday’s match will be the 40th meeting for Federer and Nadal, and it will be their first at Wimbledon since the 2008 final, which is on nearly every short list of tennis’s greatest matches and has inspired books and a documentary.

Nadal finished off that five-set classic in near darkness. Flash bulbs were required to chronicle the trophy ceremony on Centre Court. The match was widely viewed as a passing of the torch, the long-dominant Federer, then 26, ceding his spot to the irresistible youth of a 22-year-old Nadal.