Argentina and Barcelona soccer player Lionel Messi will stand trial for tax fraud in Spain, a Spanish court ruled on Thursday.

The judged rejected to drop the charges against Messi although he and his father Jorge Horacio Messi paid a "corrective" payment of $6 million in August 2013, which was the amount they allegedly owed in taxes plus interest.

If found guilty, the soccer player could face jail time. 

"There are rational signs that the criminality was committed by both accused parties," the judge wrote in a court filing, according to the AFP news agency via BBC News.

Messi and his father were accused of defrauding Spain of more than $5 million although the famous striker denies knowing anything about it. His father also continues to claim his innocence.

"We have always fulfilled all our tax obligations," Messi said.

Jorge was accused of opening offshore companies in Belize and Uruguay between 2007 and 2009 just to avoid paying taxes on his son's earnings.

Since then, prosecutors in Barcelona have cleared Messi of the tax fraud charges but want his father to spend 18 months in prison.

The judge said Messi "could have been aware" of what his father was doing so should not have his name dropped from the proceedings.

"In this type of crime, it is not necessary for someone to have complete knowledge of all the accounting and business operations nor the exact quantity, rather it is sufficient to be aware of the designs to commit fraud and consent to them," the judge wrote in the ruling.

Meanwhile, Barcelona stands behind their player stating, "The state legal service is contradicting the public prosecution officer's request and judgement."

The team released a statement to the Guardian expressing their support for Messi and charging the state attorney's judgement after prosecutors have already cleared the 28-year-old of any charges.

The Argentina star is currently recovering from a knee injury and is expected to be sidelined for up six more weeks.