The complaint was lodged by Raquel Amado, a state prosecutor for the northeastern region of Catalonia.
In it, Amado says that from 2006-2009 Messi "obtained significant revenue derived from the transfer to third parties of his image rights, income which should have been taxed."
The complaint says Messi "circumvented his tax obligations" by using shell companies in tax havens such as Belize and Uruguay.
The case was submitted for trial at the court in Gava, the upmarket Barcelona suburb near the Mediterranean coast where Messi lives.
The complaint names Messi and his father, Jorge Horacio Messi.
"We are surprised," Messi said on his Facebook account, "because we have never committed any infringement. We have always fulfilled all our tax obligations, following the advice of our tax consultants who will take care of clarifying this situation."
Messi and his father are accused of allegedly defrauding more than 4 million euros ($5.3 million) in income tax returns for the years 2007, 2008 and 2009.
A judge at the court must accept the prosecutor's complaint before charges can be brought against Messi and his father.
Sports finance analyst at the University of Navarra, Professor Sandalio Gomez, said that if found guilty of evading tax on his image rights, Messi could be liable to a fine amounting to 150 per cent of the earnings concealed. A guilty verdict would not carry a jail sentence, Gomez said.
Former Portugal star Luis Figo was last year forced to pay 2.45 million euros in income tax from his time at Barcelona. The tax authorities said the money was due from the 1997-1999 period and pertained to his image rights.
Gregor Reiter, a German attorney specializing in sports law, said Messi's difficulties show "how important it is for athletes to have excellent and highly-trained counsellors and agents" to handle their financial affairs, as player payments often travel across international borders and complicate tax assessments.
Stefan Szymanski, the Stephen J. Galetti Professor of Sport Management in the Department of Kinesiology at the University of Michigan, said the case appeared more political than football-related as tax authorities looked to make an example of Messi.
"I think it's grandstanding," he said. "They see it as a demonstration effect - everybody takes notice. Everybody thinks, I'd better pay my taxes."
He noted that different tax rates and regulations across Europe could prompt Messi to consider playing for a club in a more tax-friendly country. "If Spain is going to become as strict as northern European countries, then maybe at that point he decides that he's willing to move," Szymanski said.
He cited a 2009 study by the London School of Economics and the University of California, Berkeley which found that top tax rates have a significant influence when a footballer chooses the country in which to play.
Barcelona declined to comment.
Messi, who is rated by Forbes as the world's 10th highest-paid athlete, reportedly earned $41.3 million to June this year; with $20.3 coming from his club salary and $21 million in endorsements.
The complaint was filed a day after Messi played in Argentina's 1-1 draw against Ecuador in a World Cup qualifier in Quito.
Argentina coach Alejandro Sabella said Messi was expected to be included in the lineup for a friendly against Guatemala on Friday.
Messi signed a two-year contract extension with Barcelona in February which keeps him at the club through June 2018 — when he will be 31. He joined Barcelona when he was 13, and made his debut with the first team three years later.
The 25-year-old Messi has won four straight FIFA world player of the year awards. He has scored 133 goals for Barcelona over the last two seasons.
The forward scored 60 goals in all competitions this season, leading Barcelona to the Spanish league title.
With Messi struggling to recover from an injury, Barcelona was eliminated from the Champions League in the semifinals.
Spain has been cracking down on tax evasion as it fights to repair the country's public finances amid recession and the collapse of its once-booming real estate sector.
Finance Minister Cristobal Montoro warned footballers in April they should make sure they are "comfortable" with their tax affairs.
Associated Press writer Barry Hatton in Lisbon, Portugal, contributed to this report.Suggest a correction