Another former French Open champ, Carlos Moya, was beaten.
Ferrero defeated Belgian Kristof Vliegen 6-1, 6-2. Costa, playing in his last ATP tournament, beat past veteran American Vincent Spadea 7-6 (9-7), 4-6, 6-1.
Ferrero, the 2003 French Open winner, was last year's Barcelona runner-up to his fellow Spaniard Rafael Nadal. He won here in 2001 and also reached the final here in 2000.
Costa, a 30-year-old who lives in Barcelona, announced last week that he would retire from the tour following this tournament, which he won in 1997 and was the runner-up in 2002.
Moya lost to Russian qualifier Evgeny Korolev 7-5, 6-4. The 1998 French Open champion Moya was the Barcelona titlist in 2003.