MADRID (Reuters) - Former Spanish international midfielder Xabi Alonso has been acquitted of beating fraud, a Madrid court said on Tuesday, after prosecutors initially demanded five years in jail before cutting them for half.

According to the complaint filed against Alonso, the player evaded taxes in Spain worth two million euros for image rights between 2010 and 2012 when he defended the colors of Real Madrid, and sent them to a company based in the island of Portugal, one of the tax havens.

The Madrid court charged the beginning of this case, but closed the file, saying that the intent does not exceed the limits of raising the level of income, but the prosecution and the Tax Authority launched the case again in 2017, and the appeal judges considered the charges against the former Liverpool star "on sufficient grounds" "To reopen the file.

But the court in Madrid said on Tuesday it was impossible to talk about cover-up and fraud because the transfer of image rights was "formally done through a contract" signed in 2009 between Alonso and the Portuguese company.

Alonso, who retired from playing in 2017 after defending Bayern Munich since 2014, is among several top players who have faced and are still being scrutinized by Spanish tax authorities for irregularities in advertising income from image rights.

Some have admitted fraud as part of a deal to avoid jail time, including Atletico Madrid striker Diego Costa and Barcelona defender Gerard Pique, both of whom were fined after being convicted last summer.

Barcelona star Lionel Messi also faced the same charge, fining him 2.1 million euros and a 21-month prison sentence that eventually turned into a fine.

Earlier this year, Juventus star Cristiano Ronaldo followed in the footsteps of his former rival Messi with a two-year suspended prison sentence for tax evasion in Spain, with another financial penalty in addition to a fine imposed by the Madrid court.