A federal judge has sided with Cher, issuing a final judgment in the singer's four-year royalties war with Sonny Bono's widow that grants her almost everything she sought.

The judgment includes the payment of substantial legal costs.

US District Judge John A Kronstadt formally lodged his prior ruling that found Mary Bono, the head of her late husband's estate, was barred from using the federal Copyright Act to reclaim the 50 per cent share of Sonny's composition royalties granted to Cher in her 1978 divorce agreement with Sonny.

Mary had tried to terminate those rights - for hit songs including I Got You Babe and The Beat Goes On - along with Cher's 50 per cent share of the musical recordings.

The judge ruled that California contract law, which governed the divorce agreement, trumped the copyright termination power of the federal Copyright Act.

He then moved into new territory, holding that Cher retains her right to have her composition and record royalties paid directly to her, even though she sold the rights to Irving Azoff's Iconic Artists Group in 2022.

And while Mary had asked that neither party be allowed to recover legal costs, the judge ruled that Cher will be awarded costs as the prevailing party on all but one claim in the case.

Mary plans to appeal, her lawyer told Rolling Stone.

Cher, who will turn 80 next year, rose to fame alongside Sonny in the 1960s before building a decades-long solo career.

Sonny died in a skiing accident in 1998, leaving Mary in charge of his estate.