Rafael Nadal inspired Spain into their first Davis Cup final since 2012 as he teamed up with Feliciano Lopez to secure a dramatic last-four victory over Britain on Saturday in Madrid.
The hosts trailed 1-0 after Lopez's singles defeat by Kyle Edmund, but Nadal thrashed Dan Evans before helping secure a 7-6 (7/3), 7-6 (10/8) win in the deciding doubles over Jamie Murray and Neal Skupski.
Spain will face Canada in Sunday's final after the North Americans won their semi-final against Russia, which was also decided in a deciding doubles rubber.
Five-time champions Spain were indebted to world number one Nadal for a virtuoso display as the 33-year-old continues his hunt for a fifth Davis Cup crown, having first lifted the title himself in 2004.
"This competition is always dramatic, especially with the new format," said Nadal.
"It's really, really special. Thank you to Feli (Lopez) and to the crowd who were amazing as well."
Spain lost their last Davis Cup final to the Czech Republic six years ago.