World No 5 Ferrer beat Sam Querrey 4-6 6-2 6-2 6-4 before Almagro won a four-hour slog against giant American John Isner, 6-4 4-6 6-4 3-6 7-5.
"It was a hard match, difficult at every moment," said 30-year-old Ferrer.
Isner saved three match points in the ninth game of the decider but buckled on a fourth when he went long with a weary forehand in the 12th game.
In Buenos Aires, Argentina - yet to win the tournament and defeated by Spain in the 2008 and 2011 finals - were 1-1 in the other semi-final against the Czech Republic.
Tomas Berdych recovered from two sets to one down, and 1-4 behind in the fourth set, to stun Juan Monaco 6-1 4-6 1-6 6-4 6-4 and pull the Czechs level.
With Argentine football legend Diego Maradona and former tennis glamour girl Gabriela Sabatini amongst the raucous 13,000-crowd at Parque Roca, Berdych dug deep to claim a famous win.
Berdych won nine straight games to lead 5-3 in the decider. Monaco stopped the rot for a break to trail 4-5 before Berdych broke again to seal victory.
In the Asia-Oceania group playoff at Chandigarh, New Zealand needed to win the last three matches in their tie with India after Rubin Statham was beaten in his singles match, carried over from the first day.
Statham was beaten 6-2 6-7(5) 6-4 6-2 by Vishnu Vardhan, who had little trouble rounding off the match that had been suspended because of bad light after the first three sets.
Dan King-Turner was beaten 3-6 0-6 6-2 6-4 6-2 by Yuki Bhambri in the first match. He had won the first two sets comfortably but strained a calf muscle at the end of the second set which hampered his movement.
The winner of the tie remains in Asia/Oceania Group I with the loser playing Chinese Taipei to remain in Group I.
-AFP