Colombian pop star Shakira has struck a last-minute deal to avoid the risk of prison on the first day of her tax fraud trial in Barcelona.

Shakira, whose full name is Shakira Isabel Mebarak Ripoll, will receive a suspended three-year sentence and fines totaling $8 million, including one for nearly half a million dollars to have her sentence waived, according to AP News.

Her legal record will reportedly state that she was found guilty of tax fraud.

The pop star told the presiding magistrate on Nov. 20 that she had accepted an agreement with prosecutors and acknowledged six counts of failing to pay nearly $16 million in income taxes to the Spanish government over two years, AP News reports.

The case hinged on where the Grammy winner lived during that period, from 2012 to 2014: Prosecutors alleged Shakira spent more than half of the time in Spain and therefore should have paid taxes, even though her official residence was in the Bahamas, where the tax rate is much lower.

In July, prosecutors said they would seek a prison sentence of eight years and two months — along with a multimillion-dollar fine — for the singer, best known for her hit song “Hips Don’t Lie.”

After five years of maintaining her innocence, Shakira’s trial, which would have included more than 100 witnesses, lasted only eight minutes.

“While I was determined to defend my innocence in a trial that my lawyers were confident would have ruled in my favor, I have made the decision to finally resolve this matter with the best interest of my kids at heart,” she said in a statement.

ICIJ’s Paradise Papers and Pandora Papers previously exposed Shakira’s web of shell companies in tax havens. She was among several famous actors and musicians — including Madonna and U2 frontman Bono — named in the Paradise Papers, a 2017 investigation based on 13.4 million leaked financial records obtained by German newspaper Süddeutsche Zeitung. All denied wrongdoing.

The files showed how Shakira used the tiny island of Malta to transfer music rights valued at more than $30 million. A corporate filing listed her as a Bahamas resident and as the sole shareholder of the Maltese company. Her lawyers told reporters at the time that the arrangement complied with “all legal requirements.”

The investigation also linked Shakira to companies registered in Luxembourg and the Netherlands. In 2021, the Pandora Papers investigation, which was based on a separate leak of records from 14 offshore service providers, tied the singer to three additional companies registered in the British Virgin Islands — all of which were already under scrutiny by Spanish authorities, according to ICIJ partners La Sexta and El País.

Despite the swift end to the Barcelona trial, Shakira’s troubles with Spain’s tax office aren’t over. In September, she was charged in a separate investigation over allegedly dodging more than $7 million in income tax in 2018 by using an offshore company.