The 25-year-old had been rumoured to be suffering from a similar problem last week, but showed no signs of the injury when netting twice in the Blues' remarkable 6-3 victory at Everton on Saturday.
Chelsea paid Atletico Madrid £32m for Costa's services in July and he has begun his stay at Stamford Bridge in positive fashion - scoring four to lead the Premier League goalscoring charts in the early stages of the season.
The extent of the injury is not yet known but Chelsea manager Jose Mourinho will be hoping that Costa, who had a hamstring problem at the tail-end of last season, has shrugged off the problem by September 13, when his side host the only other Premier League team with a 100% record, Swansea.
A statement from the Spanish Football Federation said: "Diego Costa is not available for selection because of an injury to the hamstring muscle in his left thigh. All imaging tests will be sent to Chelsea."
Spain have called 19-year-old Barcelona striker Munir El Haddadi into their squad in Costa's place as they prepare to open their Euro 2016 Qualifying campaign by hosting Macedonia at the Bernabeu on Monday.
Diego Costa has been forced to withdraw from the Spain squad because he's Brazillian, sorry, injured. ;)- pires