Ferrer's three-set win handed Spain an insurmountable 3-1 lead in the best-of-five tie.
But following singles win Friday by Ferrer and Nicolas Almagro, the Sunday reverse singles win was enough to hand Spain its 23rd consecutive Davis Cup home court victory.
The Spanish squad will host the United States in the September semis.
The Americans advanced Sunday with an upset of France.
Ray Liotta sues skin care company over use of likeness
Millions of Getty images now available for free via embed tool