Novak Djokovic and Rafael Nadal are set to meet in the final of the ATP Cup after Serbia and Spain won their last-four encounters in Sydney.
After Djokovic fired Serbia into Sunday's showpiece with victory against Russia's Daniil Medvedev, Nadal ensured Spain of their place with a win over Australia's Alex de Minaur.
The world number one had to do it the hard way, fighting back from a set down against the home favourite before securing a 4-6 7-5 6-1 win.
Roberto Bautista Agut had seen off Nick Kyrgios 6-1 6-4 to put Spain ahead in the last-four tie prior to Nadal's victory.
"It's going to be a super tough final against Serbia," said Nadal on the tournament's website.
"Novak likes to play here and Serbia has a great team and is playing very well.
"But Roberto played an amazing match this afternoon and we have a good team, so we are ready for it."
Nadal's match against Djokovic will be a repeat of last year's Australian Open final.
The pair have played 54 times previously, with Djokovic having triumphed on 28 occasions. The Serb has also won nine of their last 12 encounters.
Djokovic booked Serbia's spot in the final after getting the better of Medvedev.
Djokovic took the opening set before word number five Medvedev bounced back to take the second.
But the 16-time grand slam winner showed his class in the deciding rubber to take a 6-1 5-7 6-4 victory.
It sealed an unassailable 2-0 lead for Serbia after Djokovic's team-mate Dusan Lajovic defeated Karen Khachanov 7-5 7-6 (1).
"It was exciting, exhausting, joyful, dreadful all at once," said Djokovic. "At one point we both refused to miss from the baseline, so it was a lot of rallies and it was very exhausting.
"It was a very physical battle, but also a mental battle, too. Definitely one of the most exciting matches I have played against him or any other top player in the last few years."
In the doubles, Nikola Cacic and Viktor Troicki completed a 3-0 whitewash for Serbia after they saw off Teymuraz Gabashvili and Konstantin Kravchuk 6-4 7-6 (7).