The former French Open champion will take up a new position with the Spanish federation, overseeing all the country's national teams.
The 36-year-old will head up a new structure overseeing the captains of the Davis Cup, Federation Cup and 2012 Olympic teams.
"I am proud to have the confidence of the RFET in this new stage of my professional links with the organisation that runs Spanish tennis," Costa said.
"After three fantastic years at the head of the Davis Cup team I take up this new challenge with enthusiasm, knowing that to face up to our future objectives we have an enormous tennis potential due to the quality of the sportspeople and coaches we have."
Costa led Spain to two titles during his three years in charge, also claiming the trophy in 2009.
One of his first challenges will be to find his replacement as captain of the Davis Cup team for 2012. Former world number one Carlos Moya has already ruled himself out, but Alex Corretja, who has worked with British star Andy Murray in the past, could be a live contender.
Spain will open their title defence at home to Kazakhstan in February.