Spain advanced to a last four showdown with hosts Australia at the ATP Cup following a 2-1 victory over Belgium. Roberto Bautista Agut swept past Kimmer Coppejans 6-1, 6-4 in the first singles match to give world number one Rafael Nadal the chance to wrap up the tie in Sydney.
However Nadal struggled in the heat and humidity and David Goffin took full advantage with a 6-4, 7-6 triumph.
That success for Belgium sent the tie to a decisive doubles match. Nadal returned to partner Pablo Carreno Busta against Sander Gille and Joran Vliegen and the Spaniards prevailed 6-7, 7-5, 10-7.
"It was tough because for us it was a big change from Perth to here," said Nadal. "There was not much time to adapt and the conditions were heavy. There was the humidity and we were playing against big players. We are super happy to be in the semi-finals."
Serbia progressed to the semi-finals with a 3-0 rout of Canada. Dusan Lajovic collected the first point with a 6-4, 6-2 romp past Felix Auger-Aliassime.
World number two Novak Djokovic claimed the second point but he had to labour. He dropped the first set against 20-year-old Denis Shapovalov. But Djokovic quicky restored parity against the world number 14 with a 6-1 sweep through the second set.
The decider went to a tiebreak which the 32-year-old claimed by seven points to four.
"It was so close it could have gone a different way easily," said Djokovic. "It was a great battle and it does serve me very well to have this kind of match prior to the semi-final and the Australian Open.
He added: "For my confidence, for kind of a competitive match play, this is exactly what you want to have ... against one of the best players in the world."
Serbia completed the surge with a doubles victory and will take on Russia in Sydney.