In July, Shakira rejected a plea deal. She said in the Elle interview that standing trial was “a matter of principle.”

Spanish domestic tax law uses three criteria to consider if a person is a resident of a Spanish territory: physical presence, the center of economic interests and the location of a spouse and children. In Shakira’s case, the determination of presence is key, said Adolfo Martín Jiménez, a professor of tax law at the University of Cádiz and an international taxation expert at Pérez-Llorca, a law firm in Madrid.

“Even if you are not present for that many days, a sporadic presence is regarded as presence,” Mr. Jiménez said, adding that “there’s a tendency in Spain, within the tax administration, to consider if a person is not able to prove they are resident in another country, then there’s a presumption that they are doing something strange.”

Like in the United States, Spain applies a worldwide nexus to income. Fines like the one the Spanish tax authorities are pursuing — 23 million euros — are based on income, Mr. Jiménez said.

Shakira is not the first celebrity to be the target of the Spanish tax authorities.

Cristiano Ronaldo, the Portuguese soccer star, paid $22 million in back taxes and fines as part of a 2018 settlement over undeclared earnings from his advertising contracts. As part of the agreement, Ronaldo, who played for Real Madrid for 9 years, accepted a prison sentence of two years. But under Spanish law, first-time tax offenders convicted of a financial crime are spared prison if the sentence is two years or less.

Lionel Messi, the Argentine soccer star who played for Barcelona, has also been convicted in Spain of failing to disclose some of his advertising contracts.

But Shakira having paid off the taxes, as well as an additional 1.7 million euros in interest, does not mean that she is in the clear. Carlos Cruzado, a tax expert and the president of Gestha, the tax authority technicians’ union, said prosecutors had already taken this into account as a remedy when they asked for an eight-year prison sentence.