After a long-running legal wrangle, Sir Paul McCartney and Sony have finally reached a deal regarding the ownership of publishing rights to The Beatles’ back catalogue, settling what had looked like a case that was going to shake the music industry to its foundations, according to The Hollywood Reporter.

The 75 year old star had gone to a U.S. court and sued Sony/ATV in an attempt to regain the publishing rights to 267 of the Fab Four’s classic tracks.

Paul McCartneyPaul McCartney and Sony have reached a deal over The Beatles' publishing rights

Famously, he has been trying to regain control of them since the early 1980s, when Michael Jackson out-bid him for the rights when ATV sold their own catalogue amid financial difficulties. ATV had acquired the songs when it bought out the Fab Four’s original publishers Northern Songs back in 1969. Jackson’s debt-ridden estate sold the songs to Sony in September 2016, and McCartney filed the lawsuit in New York’s federal court in January this year.

Specifically, he was seeking clarification over what is known as copyright termination, as Sony/ATV had previously remained silent over whether they intended to automatically revert the publishing rights back to McCartney when the 56-year period expires for the first of the Beatles tracks (1962’s ‘Love Me Do’ in late 2018) under the 1976 Copyright Act in America.

More: Paul McCartney’s song ‘Blackbird’ fills Stella with nostalgia

He was afraid of a similar outcome to what had happened to Duran Duran in 2016, when an English court ruled that it had superior jurisdiction over American copyright law and that the band’s 35-year old hits (the law is different for tracks after 1978…) would NOT revert back to the artist.

“The parties have resolved this matter by entering into a confidential settlement agreement and jointly request that the Court enter the enclosed proposed order dismissing the above-referenced action without prejudice,” McCartney’s attorney Michael Jacobs wrote in a letter to U.S. District Judge Edgardo Ramos, dated Thursday (June 29th).

More: How Paul McCartney landed his cameo on ‘Pirates of the Caribbean: Dead Men Tell No Tales’