Atletico Madrid striker Costa made two friendly appearances for Brazil in March, but was not involved in Luiz Felipe Scolari's FIFA Confederations Cup squad, leaving the door open for him to switch allegiances.
Players' international status is only cemented once they have played a competitive senior game for a nation, which Spain had looked to do with Costa in their upcoming FIFA World Cup qualifiers against Belarus and Georgia, but he could not be called up in time.
Spain have long chased the registration of Costa, who has lived in Europe since February 2006, when he signed for Braga.
He moved to Atleti in December that year and has established himself as a key player at the Estadio Vicente Calderon after returning to the club following a brief spell with Real Valladolid.
Two goals in Sunday's 2-1 win over Celta Vigo left Costa top of the scoring charts in La Liga with 10 goals in just eight games, but the CBF's Marco Polo del Nero is happy to wish him well with the reigning world and European champions internationally.
"The CBF believes in free will," Del Nero told O Estado de Sao Paulo.
"If a player wants to play here or there, we will not be the entity that will say no
"That's my position and I'm sure that is also the position of our president (Jose Maria Marin)."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.