The rout was completed when Nuria Llagostera Vives downed Peng Shuai in straight sets 6-4 6-4.
"We knew we could win the tie but we never expected to win three matches in a row," Vives, the 76th-ranked player in women's tennis, said during a post-match news conference. "We had our golden years with Arantxa (Sanchez-Vicario) and Conchita (Martinez) … but now we have a new team and new generation."
In a meaningless final match, Zheng Jie, who has been recovering from ankle surgery, overcame Carla Suarez-Navarro, 7-6 (7-5) 6-3, giving China its lone match win before a sellout crowd at the Beijing International Tennis Centre.
Spain, which last won the Fed Cup in 1998, faces defending champion Russia in the Fed Cup final in September.