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 in Madrid.
The hosts trailed 1-0 after Lopez's singles defeat by Kyle Edmund on Saturday, but Nadal thrashed Dan Evans before partnering Lopez in 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 the doubles rubber.
"It was a very special moment for us, a very unique opportunity," said the 38-year-old Lopez.
"We have a great opportunity to win this tournament here at home." Denis Shapovalov and Vasek Pospisil sent Canada into their maiden Davis Cup showpiece by edging out Karen Khachanov and Andrey Rublev.
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.
More From This Section
"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.
Edmund had earlier justified the decision of British captain Leon Smith to select him ahead of three-time Grand Slam champion Andy Murray by seeing off Lopez 6-3 7-6 (7/3).
But Nadal swatted aside Evans 6-4 6-0 to set up the doubles showdown.
Murray and Skupski more than held their own in the face of a partisan home crowd and a pumped-up Nadal at the Caja Magica, but saw a break point come and go in the 11th game of the first set before losing a tie-break.
The Britons saw four set points pass them by in the second set, including three in the breaker, with Nadal saving one by producing an incredible lob on the stretch.
A place in the final was sealed on a second match point.
"Rafa (Nadal) plays like this from the first round in every tournament. It's one of his powers," said Spain captain Sergi Bruguera.
- Canada make history -
=======================
"The Russians threw everything they had at us, it was just a matter of who came up with the better shots. There was no room for error today -- they went for their shots, went big in the big moments, and here we are into the final."