Lionel Messi is to face a trial for alleged tax evasion after a Spanish court rejected the Barcelona star’s appeal against his prosecution.

Messi and his father Jorge are accused of defrauding the Spanish state of more than £3.1 million ($5 million) between 2007 and 2009. They have denied any wrongdoing and will have five days to appeal against the ruling.

The Argentina international and his father are suspected of avoiding paying Spanish tax by using companies in Belize and Uruguay to sell the rights to use Messi’s image. The player has contracts with Adidas, Pepsi-Cola, Proctor and Gamble, Banco Sabadell, Danone and the Kuwait Food Company.

A court in Barcelona decided that Messi could have known about and approved the creation of a web of shell companies that were allegedly used to avoid taxes due to income from image rights.

According to court documents released on Friday, the judge ruled: “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.”

In August 2013, Messi’s father made a £3.1m “corrective payment”, equal to the alleged unpaid tax plus interest.