Cristiano Ronaldo in Beijing on July 19. VCG / VCG via Getty Images

The Spanish tax agency has agreed to a deal struck between Cristiano Ronaldo, state prosecutors and the Solicitor General’s Office by which the soccer player will pay a fine of nearly €19 million and be convicted to a two-year prison sentence.

Legal sources told the EFE news agency that the Portuguese player, who was recently transferred from Real Madrid to Juventus in Milan, will avoid going to jail in exchange for pleading guilty to four tax offenses.

In March of this year, a previous offer from the player was rejected

The settlement had been pending approval by tax authorities, whose top officials were replaced with the change of government in Spain in early June.

The case involves alleged irregularities related to Ronaldo’s image rights between the years 2011 and 2014, during which time he is thought to have evaded €14.7 million in taxes. The final agreement reduced that amount to €5.7 million, but interest payments and the fine raise the total to nearly €19 million.

In March of this year, a previous offer from the player was rejected by the Spanish tax authorities. Sources close to the investigation described a meeting with Ronaldo several months ago as “very unsatisfactory,” as he offered an “insignificant amount” of around “four or five” million euros. The Tax Agency rejected the offer and opted instead to press on with its criminal proceedings against the player.

The Madrid prosecutor in charge of the case has accused Ronaldo of taking advantage of a corporate structure created in 2010, the year after he was signed by Real Madrid from Manchester United, in order to conceal income generated in Spain from image rights. That was, the prosecutor argues, a “voluntary” and “conscious” failure to meet his tax obligations in Spain.