The Barcelona star has come under regular fire for his performances on the field and his support off the pitch for his pro-Catalan stance.
"The World Cup in Russia is going to be my last tournament with the national team and I hope to take a lot of pleasure from these last two years," he said after Sunday's 2-0 qualifying win against Albania.
"This is not a decision that I have taken today, I have been thinking about it. But the criticisms today have added to what has happened over the last few years.
"There are also people who believe that it's better that I am not here," added Pique who will be 31 when the 2018 World Cup takes place.
Pique, who has often been jeered by Spanish fans, played in the Spain team which won the 2010 World Cup and 2012 European championships.