Novak Djokovic could not prevent Serbia missing out on the Davis Cup final after he and Filip Krajinovic lost in the decisive doubles against Croatia.
Djokovic beat former US Open champion Marin Cilic in the singles, levelling the semi-final tie after Croatia's Borna Gojo won against Dusan Lajovic.
Nikola Mektic and Mate Pavic, the world number ones, put Croatia into the final with a 7-5 6-1 win in Madrid.
Croatia will play either the Russian Tennis Federation or Germany on Sunday.
The Russians, with top-five players Daniil Medvedev and Andrey Rublev in their team, were the pre-tournament favourites and face Germany in the second semi-final on Saturday (12:00 GMT).