The 34-year-old revealed at a press conference with Barcelona on Tuesday that he has decided to hang up his Spain boots after winning 133 caps and helping La Roja win the 2010 World Cup and back-to-back European Championships.
"I've taken the decision to leave the national team. My time there has finished," he said.
"From now on I'm another fan of the Spain team.
"I'm grateful to everybody at the Federation (RFEF), it's been a marvellous time for me to be there for so many years and have so much success. I'm leaving very proud and I wish them all the best."
Xavi made his international debut in 2000, the same year as he helped Spain win an Olympic silver medal in Australia.
Further success came in 2008 when he was named player of the tournament as Spain won the European Championship in Austria and Switzerland - the country's first international success since 1964.
Two years later Xavi was a key part of the Spain squad that won the World Cup for the first time in their history, and then in 2012 he helped his country retain their Euro crown in Poland and Ukraine.