Serbia edged a tight doubles encounter against Spain on Saturday to seal a place in the Davis Cup by BNP Paribas semi-finals for the first time since 2013.