Atletico Madrid's Diego Costa leaves the pitch after his substitution during their Spanish First division soccer league match against Villarreal at El Madrigal stadium in Villarreal, November 10, 2013. REUTERS/Albert Gea

MADRID (Reuters) - Atletico Madrid's Brazil-born forward Diego Costa has withdrawn from the Spain squad for their friendlies against Equatorial Guinea and South Africa after tearing a muscle in his right leg in La Liga action on Sunday.

Costa, who was substituted in the 83rd minute of Atletico's 1-1 draw at Villarreal, has been replaced by Juventus striker Fernando Llorente, the Spanish soccer federation (RFEF) said on the world and European champions' website (www.sefutbol.com).

Costa was the subject of a tug-of-war between Brazil and Spain before he signed a formal letter last month stating his wish to play for his adopted country and was called up for the first time by coach Vicente del Bosque.

He has dual Spanish and Brazilian nationality and is second on the La Liga scoring chart this season with 13 goals, three behind Real Madrid forward Cristiano Ronaldo.

Costa represented Brazil in friendlies against Russia and Italy in March but was left out of the squad for June's Confederations Cup and is not tied to one country until he has played in an official competitive game.

He was the fifth Brazilian-born player to be selected for Spain following Heraldo Becerra, Catanha, Donato and most recently Marcos Senna.

Spain play Equatorial Guinea in the West African nation's capital Malabo on November 16 and take on South Africa three days later at Soccer City in Johannesburg, scene of their maiden World Cup triumph in 2010.

(Reporting by Iain Rogers, editing by Ed Osmond)