The Real Madrid midfielder will concentrate on club football after Spain’s disastrous World Cup campaign.
Xabi Alonso is quitting international football after Spain’s elimination from the World Cup in Brazil.
Defeats to the Netherlands and Chile mean that the current holders will fly home after their final group game against Australia on Monday.
The 32-year-old former Liverpool midfielder has been capped 113 times by his country, scoring 16 goals, and was a key player as Spain won two European Championships and the 2010 World Cup in South Africa.
“When I spoke of the lack of hunger, I wasn’t speaking of commitment or cohesion in the group, but more during our games we couldn’t deliver that competitive intensity that you need in these finals,” he said after the defeat to Chile.
“The feeling is the same with all of my colleagues that I have spoken to,” he added. “We haven’t been at the right level, and we have lacked that tension needed.”