Spain's world number one Rafael Nadal redeemed a singles defeat with dramatic victory in the doubles, earning his country victory over Belgium in their ATP Cup quarter-final at the Ken Rosewall Arena in Sydney.
In stifling heat, Nadal missed the chance of giving Spain an insuperable 2-0 lead when he was beaten in straight sets by David Goffin - but in partnership with Pablo Carreno Busta, he sealed a 2-1 win and a semi-final against the hosts in a match that went to a deciding tiebreak.
Belgium were one set away from the last four, after Sander Gille and Joran Vliegen won the opening set 7-6 (9-7).
But 33-year-old Nadal and his partner responded to take the second set 7-5, moving the match into a deciding tiebreak which they won 10-7.
Roberto Bautista Agut had put Spain into a 1-0 lead with a relatively simple 6-1, 6-4 win in the opening singles against Kimmer Coppejans.
But Nadal, a 19-time grand slam winner, was unable to take the opportunity to settle the match, losing 6-4, 7-6 to Goffin as the Belgian achieved one of the greatest results of his career.
The world number 11 took the initiative in the ninth game with a backhand winner down the line that forced Nadal into an error off his forehand, giving the Belgian a 5-4 lead which he consolidated in the next game.
Goffin broke Nadal's serve again early in the second set, racing to a 2-0 lead.
The Spaniard fought back to take the second set to a tiebreak, but Goffin won that 7-3 to keep his nation's chances alive.
Nadal had only lost one professional encounter in the previous six months, during which period he earned US Open and Davis Cup titles.
But his day was to finish on a high.
Serbian world number two Novak Djokovic also had a testing day, taken to three sets by Canada's Denis Shapovalov, eventually coming through on a tiebreak 4-6, 6-1, 7-6 (7-4).
Following Dušan Lajović's 6-4, 6-2 win over Félix Auger-Aliassime that gave Serbia an unassailable lead, and the whitewash was completed as Nikola Čačić and Viktor Troicki earned a 6-3, 6-2 win over Peter Polansky and Adil Shamasdin.
Serbia will meet Russia in the first of tomorrow's semi-finals.
The inaugural men's team tournament is viewed as a rival to the revamped Davis Cup, held for the first time as one 18-team competition in November.
It is taking place in Australia amid the bushfire crisis which has devastated much of the country, with many players and the ATP donating to the cause.