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).
Germany are without world number three Alexander Zverev, who did not want to play in the revamped 18-nation Davis Cup Finals, but reached the last four by beating Great Britain in the quarter-finals.
Croatia must wait to see who they will face after seeing off their Balkan neighbours in Friday's first semi-final.
Croatia won the first singles rubber when world number 279 Gojo fought back to win 4-6 6-3 6-2 against Lajovic, stretching his 100% record to three victories in a dream Davis Cup Finals for the 23-year-old.
Djokovic levelled the best-of-three tie by earning his 19th consecutive Davis Cup singles victory, fighting off eight break points against Cilic before winning 6-4 6-2.
That teed up a intriguing doubles match which featured the world's best pairing and its leading singles player.
Mektic and Pavic, who won the Wimbledon and Olympic titles in a dominant 2021 season, had won all three of their Finals matches in straight sets and again showed their quality to do the same against their Serb opponents.
A tight first set swung the Croats' way with the first break of the match in what proved to be the final game, then an early break in the second put them in command.
Djokovic was left kicking his bag in frustration as the Serbs trailed 3-1, sensing that it would be difficult for him and Krajinovic to fight back.
So it proved. The doubles specialists quickly won the next three games to put the 2005 and 2018 champions into a fourth final.