Real Madrid forward Cristiano Ronaldo denied hiding millions of euros in income at a court hearing near the Spanish capital on Monday where he was charged with tax evasion.

The Portuguese footballer - the world's highest-paid sportsman according to Forbes magazine - is the latest football star to fall foul of Spain's taxman.

He follows in the footsteps of his arch-rival, Barcelona forward Lionel Messi, who was found guilty of the same offence last year.

"I have never hidden anything, nor have I had the intention of evading taxes," Ronaldo, 32, told the court, according to a statement from the sports agency which represents him, Gestifute.

OPINION: Why does FIFA still recognise Israeli settlement teams?

"I always voluntarily file my tax returns because I think we all must file a return and pay taxes according to our income. Those that know me, know what I ask my advisers: that they have everything up to date and properly paid, because I don't want problems."

Accused of having evaded 14.7m euros ($17.3m) in tax, he entered and left the court in Pozuelo de Alarcon, a wealthy suburb of Madrid where he lives, via an underground garage to avoid the press.

Prosecutors allege he took "advantage of a company structure created in 2010 to hide income generated in Spain from his image rights from tax authorities".

They say this was a "voluntary and conscious breach of his fiscal obligations in Spain".

Prosecutors accuse the four-time world player of the year of evading tax via a shell company based in the British Virgin Islands and another in Ireland, known for low corporate tax rates.

In addition, they say the Real Madrid striker declared only 11.5m euros ($13.6m) of Spanish-related income from 2011 to 2014, while what he really earned during that time was close to 43m euros ($50.8m).

They also accuse him of "voluntarily" refusing to include 28.4m euros ($33.6m) in income linked to the sale of his image rights for the 2015 to 2020 period to a Spanish company.

Madrid judge Monica Gomez Ferrer now has to decide if the investigation goes to trial.

'Legal and legitimate'

Ronaldo told the court he did not create a "special structure" to manage his image rights when he moved to Real in 2009 but simply maintained the one set up in 2004 while he was at Manchester United "long before I thought of coming to Spain".

This structure had been deemed "legal and legitimate" by the British tax office.

The affair has taken its toll on Ronaldo.

According to press reports, Real's all-time top goalscorer threatened to leave Spain over the affair, giving supporters a fright.

READ MORE: Football's road to recognition in war-torn Afghanistan

He has since decided to stay on, according to Real coach Zinedine Zidane.

If he were put on trial and found guilty, Ronaldo would risk "a fine of at least 28 million" euros ($33.1m) and could potentially be jailed for three and a half years, the Gestha union of experts at Spain's Inland Revenue has said.

Since extending his contract last November until 2021, Ronaldo is the highest-paid sports star in the world, with $93m earned in 2016-2017, according to Forbes.

Ronaldo is not the only footballer to fall foul of authorities in Spain, which is only just recovering from a damaging economic crisis that saw countless people lose their jobs and inequalities rise.

Messi was sentenced to a 21-month jail sentence and 2.09 million-euro ($2.47m) fine last year for tax fraud.

His prison sentence has since been replaced by another fine of 252,000 euros ($298,000), which corresponds to 400 euros ($473) for each day of jail.

Barcelona's Argentine defender Javier Mascherano, meanwhile, agreed a one-year suspended sentence with authorities for tax fraud last year.

In Spain, a judge can suspend sentences of less than two years for first-time offenders.

Brazil star Neymar, another Barcelona forward, and his parents are also due to stand trial for alleged corruption over his transfer from Santos in 2013.

Real have not been spared either.

Apart from Ronaldo, former player Angel di Maria, Portuguese defender Fabio Coentrao and Jose Mourinho, who coached the club from 2010 to 2013, have all been accused of tax fraud.

All are clients of super-agent Jorge Mendes, who was also questioned and put under official investigation last month by a Spanish court investigating alleged tax evasion by Monaco's former Atletico Madrid striker Radamel Falcao, another footballer in his stable.