The men’s final that tennis and this tournament craved once Novak Djokovic and Andy Murray had departed early is a done deal. Rafael Nadal will play Roger Federer on Sunday to contest the Australian Open title, a reprise of 2009 when the Spaniard beat the Swiss in five sets, but now he has to recover from nearly five hours of the electric tennis he endured in subduing Grigor Dimitrov. Nadal, who lost nearly two months last season with a wrist injury, beat the superb young Bulgarian 6-3, 5-7, 7-6 (7-5), 6-7 (4-7), 6-4 and looked spent when they embraced at the net, but lifted by the ovation of the packed Rod Laver Arena.

“I hope to recover well,” the 30-year-old Spaniard said courtside. “For me, it is a privilege [to play Federer]. I think it is a very special thing for both of us to compete in a final again. I was with Roger at the opening of my academy in Majorca. We were talking there, but we were injured so just played some shots with the kids. Both of us never thought we’d be here together in a final again.”

They were not alone. There are not many in the game who would not relish a 35th meeting between probably the two best players in the game. Nadal has won 23 times yet there will be very little between them.

Federer, 35, beat Stan Wawrinka in five sets on Thursday – but in two hours fewer than Nadal needed to secure his win – to get back in the big time, and Friday’s semi-final was even better, rich with glorious shot-making and some of the best defence of the fortnight. The result was in doubt all the way to the final game.

Nadal and Dimitrov have freshened up their personnel in recent months and it has revitalised their tennis. Carlos Moyá, who lost to Pete Sampras in the 1997 final here, was a voluble presence in Nadal’s box alongside his uncle Toni – as was the player’s long-time girlfriend, Xisca Perello, whom he cheekily revealed this week was at the tournament for the first time in 10 years, “on a wildcard”.

Team8, the boutique management company Federer set up in 2013 with his agent, Tony Godsick, played a part in Dimitrov’s development, meanwhile, as the Bulgarian inherited Andy Murray’s former training assistant, Dani Vallverdu, from Juan Martín del Potro, who is also a Team8 client.

Vallverdu had previously worked with Tomas Berdych, who collapsed here against Federer in the third round. Dimitrov, whose 10 straight wins this year represent his best start to a season, began brilliantly from the first exchange of the day, but he could not sustain the charge under quality pressure from Nadal, who served three games in a row to love to close out the opening set in only 35 minutes.

In the second, Dimitrov again unleashed a blur of attacking shots, trying to pin his opponent deep behind the baseline. But that is where the best clay-court player of them all has spent most of his career but, rattled by a time violation at love-30 in the fourth game, he shoved a forehand into the tramline to hand Dimitrov the break.

Dimitrov’s concentration dipped and he blew a 4-1 lead as Nadal worked his way back towards parity, only to double-fault and drop serve again in the eighth game. Dimitrov was three points from taking the set, when Nadal drew him into a baseline fight and the younger player dumped a forehand for five-all.

Nadal hit one of those wonder shots that only a player with steel-strength wrists could play: lining up a crosscourt running forehand then switching it down the line. Still Dimitrov came at him, and grabbed four set points in the longest game of the match to that stage, but could not cash in. He atoned in the 12th game and won a set he had looked like losing.

After two hours they could not have been much closer: a set apiece and two-all in the third after trading breaks again. But both were vulnerable. As they continued to hit freely, there were more chances than in a Friday-night bingo hall, and Nadal eked out another break to pull clear.

Neither of them was convincing with ball in hand and Nadal slapped his third double fault, and saved four break points, before butchering the simplest of mid-court forehands.

Facebook Twitter Pinterest Grigor Dimitrov and Rafael Nadal during a rally. Photograph: Julian Smith/EPA

There was an unscheduled pause of six minutes after two and a half hours, as Nadal waited to serve at 5-6, when a spectator required medical attention. When they met here in the quarter-finals in 2014, they were a set each when they went to the first of two tie-breaks. Nadal won that one, and the match. Here he hung on, forcing a final limp forehand from his tiring opponent to go 2-1 up.

An hour short of midnight, and after three and a quarter hours on court, they were locked at two-all in the fourth set. Nadal, one game from the final at 5-4, had to face new balls on Dimitrov’s serve and could do nothing about the 14th and 15th aces to fly by him. He held his own serve with a reflex flick at the net, his 19th success in 21 visits.

Dimitrov, serving again to stay in the match, stuck another ace down the T, but followed it with his fourth double fault before forcing a second tie-break. Dimitrov got three set points with a backhand volley, was passed at the net, then overpowered Nadal with another big serve to level at two-all.

Nadal, 31 and six years older than Dimitrov, had spent more than 14 hours winning five matches; the Bulgarian’s wins had taken him about three hours fewer. While Nadal is more at home in these grinding circumstances, Dimitrov’s stamina and movement after a tough winter break training in Florida with Vallverdu, were impressive – and he was the one desperate for a fifth set after nearly four hours.

It took him more than 10 minutes to hold at the start of the deciding frame, saving break point through four deuce points, but he could not convert two chances to break in the second game.

Venus and Serena Williams create a new chapter in this remarkable family story Read more

He looked commanding to hold for 2-1, an 18th ace down the middle following two splendid winners under pressure, but he turned an ankle hunting down a lob. In the fifth game, his footwork faltered on a couple of shots but he saved break point to stay in front.

Nadal went to another level to save in the eighth game and the decibels reached rock concert level. He was further encouraged when Dimitrov double faulted then hit long off the tape to hand him break point in the ninth. He finished the job with a backhand into the deuce corner, after sprinting from deep, and served for the match.

Dimitrov fought all the way to the end, forcing deuce twice before Nadal converted his third match point when his young opponent’s final backhand drifted long near his feet. Nadal is now 183-4 after winning the first set in majors.

“I was tired, but Grigor was unbelievable,” he said. “It was a great match. I feel very happy to be part of it. The crowd was amazing. These have been two unforgettable weeks. When you work hard, when you have some tough moments, it takes a while to come back to the level I had. I worked a lot for a month and a half after Roland Garros [where he withdrew after winning two matches], but I never dreamed to be back in a slam final after two tournaments.”