It was 1974, the year Sophia Loren starred alongside Richard Burton in Vittorio de Sica's final film, The Voyage (Il Viaggio). It was also the year that marked the start of an almost four-decade battle with the Italian tax authorities – a battle that has finally ended.

In a verdict she described as "a miracle", Loren, 79 and living in Geneva, was declared by Italy's supreme court to have been in the right over calculation of tax paid on her 1974 earnings. Her accountants said she should pay 60% while the authorities said 70% was due.

"I am happy. A saga that has been going on for almost 40 years has finally ended," Loren, who remains one of Italy's most legendary and beloved actors, was quoted as telling La Stampa on Wednesday after the court of cassation's ruling. She added: "I always look to the future. I leave behind me horrible experiences like this."

Italy's notoriously slow-moving justice system leaves room for repeated appeals by both the prosecution and defence, but the court of cassation, the country's top appeals court, is where the buck stops. With its definitive ruling on the Loren case, the court's judges were "closing a Kafkaesque affair", said her lawyer, Giovanni Desideri. In an official statement, Loren said: "This is an old saga of more than 30 years in which, finally, I was in the right."

The long-running battle was separate from another tax-related saga that saw Loren, a world-famous screen star with several awards, including an Oscar, under her belt, spend 17 days in a southern Italian prison as part of a 30-day sentence for tax evasion. When she left the jail in 1982, the Neapolitan was met by crowds of journalists and fans. She said the sentence was unjust and her accountant had made a mistake on her tax return.

Loren, whose career kicked off in the 1950s and arguably reached a peak with her role in De Sica's multi-award-winning film Two Women (La Ciociara) in 1960, is reported to be making a comeback in an adaptation – directed by one of her sons, Edoardo Ponti – of Jean Cocteau's play The Human Voice (La Voix Humaine).