Costa began his football career in his native Brazil before joining Braga in Portugal in 2006, aged 17. He never played for the club but spent time on loan at Penafiel, and signed with Atlético Madrid the following year. Over the next two seasons he had loan periods with Braga, Celta Vigo and Albacete. His form earned him a move to fellow La Liga club Real Valladolid in 2009, where he spent one season, finishing as their top goalscorer, before returning to Atlético Madrid. Costa struggled to maintain a regular starting role with Atlético, and spent more time on loan, this time at Rayo Vallecano, where he finished as the club's highest scorer that season.