Rafael Nadal helped hosts Spain see off Argentina in a deciding doubles contest, setting up a semi-final against Great Britain.
Serbia had hoped to mark Janko Tipsarevic's farewell by winning the Davis Cup, but Russia ruined those plans in Madrid on Friday.
Thanks to Novak Djokovic and Filip Krajinovic, Serbia reached the Davis Cup quarter-finals alongside Great Britain and Germany.
Croatia's hopes of retaining the Davis Cup are over after they were beaten by hosts Spain in Madrid.
Rafael Nadal is second only to Roger Federer on the men's grand slam all-time list - but his uncle says he could have been clear at the top.
Matching Roger Federer and Novak Djokovic for year-end number one rankings pleased Rafael Nadal.
Despite concerns over his elbow, Novak Djokovic is set to play at the Davis Cup Finals.
For the fifth time in his career, Spanish great Rafael Nadal will finish the year as world number one.
Novak Djokovic exited the ATP Finals after a straight-sets loss to Roger Federer, who said: "It was definitely magical."
Rafael Nadal clinched the year-end number one after Roger Federer eliminated Novak Djokovic from the ATP Finals.