Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

MADRID — Soccer superstar Cristiano Ronaldo pleaded guilty to tax fraud Tuesday and received a two-year suspended jail sentence.

The Juventus forward, who was facing charges stemming from his days at Real Madrid, was in court for about 45 minutes and signed an agreement which will cost him nearly 19 million euros ($21.6 million) in fines.

Soccer star Cristiano Ronaldo and his partner Georgina Rodriguez arrive at a court in Madrid, Spain, on Tuesday. Emilio Naranjo / EPA

Ronaldo made the deal to plead guilty with Spain's state prosecutor and tax authorities last year.

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

In 2017, a state prosecutor accused Ronaldo of four counts of tax fraud from 2011-14 worth 14.7 million euros ($16.7 million).

Ronaldo, 33, was accused of having used shell companies outside Spain to hide income made from image rights.

He had to enter the courtroom through the front door after his request for special security measures to avoid the spotlight was denied on Monday.