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.