Spain beat Germany to reach the Davis Cup semi-finals after Rafael Nadal and David Ferrer won both singles matches on Sunday.
Germany led 2-1 after Saturday's doubles but world number one Nadal levelled the tie with a 6-1 6-4 6-4 victory over Alexander Zverev.
Ferrer beat Philipp Kohlschreiber 7-6 (7-1) 3-6 7-6 (7-4) 4-6 7-5 in the deciding rubber in Valencia.
Holders France will host Spain in the final four after beating Italy.
France won Saturday's doubles to lead 2-1 and Lucas Pouille secured the win in the fourth match by beating Fabio Fognini 2-6 6-1 7-6 (7-3) 6-3.
Croatia will take on the United States in the other semi-final, with both ties to be played on 14-16 September.
Fourth seeds Croatia wrapped up a 3-1 win over Kazakhstan on Sunday as world number three Marin Cilic thrashed Mikhail Kukushkin 6-1 6-1 6-1 in Varazdin.
The United States took an unassailable 3-0 lead over last year's runners-up Belgium in Nashville on Saturday.
Nadal was playing his first event back since retiring with a hip problem against Cilic in the last eight of the Australian Open in January.