Novak Djokovic beat Roberto Bautista Agut, 6-2, 4-6, 6-3, 6-2, to reach a Grand Slam final for the 25th time. (Andy Rain/pool photo via Associated Press)

WIMBLEDON, England — With Wimbledon’s dream semifinal between Roger Federer and Rafael Nadal yet to be contested, defending champion Novak Djokovic did his part Friday to ensure Sunday’s final will be a showdown between two of the world’s top three players.

The top-ranked Djokovic was forced to produce his best tennis of the tournament to defeat Roberto Bautista Agut, 6-2, 4-6, 6-3, 6-2, who nearly proved a disrupter in his first Grand Slam semifinal before succumbing to Wimbledon’s four-time and defending champion.

Djokovic’s reward is the 25th Grand Slam final of his career and the chance to inch closer to the record 20 major titles held by Federer or the 18 held by Nadal. Djokovic has 15.

The Federer-Nadal semifinal was to follow shortly on Centre Court, and thousands of tennis fans jammed onto the large hill on the grounds of the All England Club to watch a reprise of the 2008 Wimbledon final on an oversize TV screen.

In terms of anticipation, the Djokovic-Batista Agut semifinal felt like an undercard compared to the Federer-Nadal clash in store.

Djokovic, 32, had faced only one seeded player (David Goffin) in breezing to Wimbledon’s final four after early-round upsets bounced four top-10 players from his half of the draw.

Bautista Agut, 31, was the final hurdle. By ranking (22nd), he should not have presented much of a threat to Djokovic, who had won three of the previous four Grand Slams.

Seeded 23rd, Bautista Agut was as surprised by his march to Wimbledon’s semifinal as anyone, having scheduled his bachelor party in Ibiza for the tournament’s final weekend. The party was postponed, and his buddies flew to England to join Bautista Agut’s fiancee in cheering him on.

Djokovic claimed the opening set in just 36 minutes, looking virtually untouchable.

But with Djokovic’s forehand and focus straying, Bautista Agut took the second set, 6-4, to level the match at one set each. With the Spaniard making it a match, Djokovic flapped his arms at the capacity crowd in an effort to coax a show of support.

He found his own motivation in the third set and rolled to the victory, clearing the stage for the 40th edition of Federer vs. Nadal and only their fourth meeting at Wimbledon.

Read more:

A renewed Serena Williams and a transformed Simona Halep cruise to Wimbledon final

John McEnroe has matured into a much-loved figure at Wimbledon

Coco Gauff loses at Wimbledon, but the tennis world thinks it will hear from her again

Serena Williams, Andy Murray knocked out of mixed doubles