The 26-year-old Argentine, four times Fifa World Player of the Year, and his father Jorge Messi are accused of defrauding the authorities of more than 4m euros ($5.4m; £3.4m).
They are suspected of using companies abroad – in Belize and Uruguay – to sell the rights to use Messi’s image.
They both deny the allegations, which date back to 2007-09.
The striker gave a thumbs up as he arrived at the court in Gava – the affluent Barcelona district where he lives.
Messi and his father are being questioned in a closed-court session. They are accused of three counts of defrauding the Spanish state of taxes.
Lionel Messi’s father Jorge (centre) arrived at the courthouse before his son
The income related to Messi’s image rights included contracts with Banco Sabadell, Danone, Adidas, Pepsi-Cola, Proctor and Gamble, and the Kuwait Food Company.
In August, Jorge Messi made a payment of 5m euros to the tax authorities – the 4.16m euros of the alleged unpaid tax plus interest.
But state prosecutors are still pursuing the case – as the tax authorities are taking a much tougher line as a result of Spain’s economic crisis, reports the BBC’s Tom Burridge in Madrid.
Earlier, Messi stated that he and and his father “have never committed any infringement. We have always fulfilled all our tax obligations”.
Messi’s net salary from Barcelona is said to be about 16m euros a year, making him one of the world’s most highly-paid sportspeople.
He has also signed multi-million-dollar endorsements with commercial sponsors around the world.
Messi’s achievements on the field have made him one of the most marketable in the business.
He came from a modest background and has overcome a serious health issue, joining Barcelona as a 13-year-old in 2000 and making his first-team debut only three years later.
But the allegations are a big blow to the prestige of the player, who has long been seen as a more humble figure than most top-class footballers.