World number one Carlos Alcaraz sealed Spain's berth in the Davis Cup quarter-finals on Sunday by beating South Korea's Kwon Soon-woo in straight sets.
US Open champion Alcaraz won 6-4, 7-6 (7/1) against his 74th-ranked opponent at home in Valencia, after Roberto Bautista Agut had earlier beaten Hong Seong-Chan 6-1, 6-3.
After their surprise 2-1 loss to Canada on Friday, in which Alcaraz lost to Canadian Felix Auger-Aliassime, the Spaniards won in the singles against South Korea.
"Playing the Davis Cup here is an honour for me," Alcaraz told the crowd after the match. "But it's even better to come here being No. 1 in the world and US Open champion, to share this moment with all my people, my family, my friends."
First in Group B ahead of Canada, the Spaniards will meet Croatia in the quarter-finals in November, in front of their home crowd in Malaga. Serbia, in third, have been eliminated.
In Hamburg, Germany took the top spot in Group C ahead of Australia after doubles pairing Kevin Krawietz and Tim Puetz's 6-4, 6-4 victory over Matthew Ebden and Max Purcell.
That gave the hosts a 2-1 victory.
In singles, Thanasi Kokkinakis beat Oscar Otte 7-6 (8/6), 6-1 to keep Australia in the tie after Germany's Jan-Lennard Struff eased past Purcell 6-1, 7-5.
Germany and Australia had already secured the top two spots in Group C with wins over France and Belgium earlier in the group stage.
The Germans next meet Canada and Australia play the Netherlands.
The Dutch finished the group stage undefeated in their Group D, where Andy Murray's Britain claimed third place by beating Kazakhstan with difficulty after the doubles on Sunday where each set was a tie-break as Joe Salisbury and Neal Skupski edged Alexander Bublik and Aleksandr Nedovyesov 7-6 (7/2), 6-7 (9/11), 7-6 (7/4)
In Bologna, Croatia advanced to the last eight thanks to Italy's 2-1 win over Sweden in Group A.
Croatia, finalists of the 2021 edition, had started the competition with a heavy 3-0 loss to Italy before reacting against Sweden (2-1) and then Argentina (3-0).
The Croatian team took second place, qualifying behind Italy, while Sweden, third, were eliminated.
Italy, who finished the group stage unbeaten and had already qualified, will next face the United States, who finished second in Group D behind the Netherlands.