Barcelona captain Lionel Messi said on Wednesday he had considered leaving the Catalan club when he was questioned for tax evasion in 2013, saying he felt "bad treatment" in Spain.

Messi, who has played in Barcelona since the age of 13 and became the club's all-time top scorer, and his father Jorge in 2016 were convicted of defrauding the Spanish government in taxes worth 4.2 million euros ($ 4.61 million) between 2007 and 2009 in connection with the earnings of his image rights.

A court sentenced Messi to 21 months in jail for tax evasion and fined him 2 million euros. Messi has not been jailed after being sentenced to a 250,000-euro fine.

In Spain, defendants without previous convictions are allowed not to carry out any sentence of less than two years.

Messi, 32, was first investigated in 2013 as a series of tax fraud cases began against Spain's top footballers, including Cristiano Ronaldo, Javier Mascherano and Marcelo.

"Honestly during this time I was thinking about leaving. Not because of Barcelona but because I wanted to leave Spain. I felt very bad treatment and I didn't want to stay here any longer," Messi said in an interview with RAC1.

"I have opened the door for many clubs but I have not received any official offer because everyone understands that I really want to stay. This attitude has nothing to do with my feelings for Barcelona."

Messi said he felt Spanish tax authorities had treated him as a model and an example of intensifying efforts to combat tax fraud after the country's economic crisis.

"I was the first and this explains why they have dealt with me very much. They have set a model in their dealings with me and showed that everyone will be treated like this.