Ed Sheeran has won a High Court copyright battle over his 2017 hit Shape of You.
A judge ruled on Wednesday that the singer-songwriter had not plagiarised the 2015 song Oh Why by Sami Chokri.
Chokri, a grime artist who performs under the name Sami Switch, had claimed the "Oh I" hook in Sheeran's track was "strikingly similar" to an "Oh why" refrain in his own track.
After the ruling, Sheeran said such "baseless" claims "are way too common".
In a video on social media, he said there was now a culture "where a claim is made with the idea that a settlement will be cheaper than taking it to court, even if there's no basis for the claim".
He added: "It's really damaging to the songwriting industry. There's only so many notes and very few chords used in pop music.
"Coincidence is bound to happen if 60,000 songs are being released every day on Spotify. That's 22 million songs a year and there's only 12 notes that are available."
Shape of You was the UK's best-selling song of 2017 in the UK and is Spotify's most-streamed ever.
Judge Antony Zacaroli ruled that Sheeran had "neither deliberately nor subconsciously copied" Chokri's song.
He acknowledged there were "similarities between the one-bar phrase" in Shape of You and Oh Why, but said "such similarities are only a starting point for a possible infringement" of copyright.
After studying the musical elements, he said there were "differences between the relevant parts" of the songs, which "provide compelling evidence that the 'Oh I' phrase" in Sheeran's song "originated from sources other than Oh Why".
He added that there was only a "speculative foundation" for the defence's case that Sheeran had heard Chokri's song before writing Shape of You. "I find, as a matter of fact, that he had not heard it," he said.
Sheeran wrote his chart-topping track with two collaborators, Snow Patrol's John McDaid and producer Steven McCutcheon, who all denied having previously heard Oh Why.
The case dates back to 2018, when the trio asked the High Court to declare they had not infringed the copyright of Chokri and his co-writer Ross O'Donoghue. That led to an 11-day trial in London last month.
This ruling will come as a huge relief to Ed Sheeran, who took the unusual step of pre-emptively suing Sami Chokri and Ross O'Donoghue in 2018 in an attempt to clear his name.
He was stung by the accusation that he'd deliberately copied another writer's work without giving them credit. On the witness stand, the star was often terse and abrupt as he explained how, in several other instances, he shared royalties with writers who inspired him. Even on Shape of You, he protested, some of the profits went to the writers of TLC's No Scrubs.
He later sang Nina Simone's Feeling Good and Blackstreet's No Diggity on the stand in an attempt to prove the melody he was accused of stealing was commonplace in pop music.
Chokri was more emotional. He said he felt "robbed" by an artist he respected, and that he wished the trial had never come to court. However, he remained adamant that Sheeran had heard and copied his song.
In the end, the judge disagreed. In order for copyright infringement to be proved, Chokri needed to prove that Sheeran had listened to his song - otherwise the similarities would just be coincidence. But Mr Justice Zacaroli said Chokri's team had failed to establish that Oh Why had ever graced Sheeran's speakers.
As a star who has faced his fair share of copyright claims, Sheeran will presumably hope this verdict makes future litigants think twice.
The Shape of You songwriters took legal action in 2018 after the track's royalties were frozen when Chokri and O'Donoghue asked the Performing Rights Society (PRS) to add them to the hit's credits as co-writers.
Shape of You earns Sheeran, McDaid and McCutcheon about £5m a year, the court heard, despite almost 10% of the payments having being frozen due to the dispute.
In his ruling, Mr Justice Zacaroli said Sheeran and his collaborators were justified in thinking the request from Chokri and O'Donoghue to be named as co-writers "was a tactic designed to extract a settlement".
After the initial legal action, Chokri and O'Donoghue launched a counter-claim alleging copyright infringement.
In a joint statement after the judgement, Sheeran, McDaid and McCutcheon said their mental health and creativity had suffered as a result of the case, as well as their wallets.
"There was a lot of talk throughout this case about cost," they said. "But there is more than just a financial cost. There is a cost on creativity. When we are tangled up in law suits, we are not making music or playing shows.
"There is a cost on our mental health. The stress this causes on all sides is immense. It affects so many aspects of our everyday lives and the lives of our families and friends. We are not corporations. We are not entities. We are human beings."
Giving evidence last month, Sheeran denied that he "borrows" ideas from unknown songwriters without acknowledgement, insisting he was always "completely fair" in crediting people who contribute to his work.
Andrew Sutcliffe QC, representing Chokri and O'Donoghue, labelled Sheeran a "magpie", claiming he "habitually copies" other artists and that it was "extremely likely" he had previously heard Oh Why.
In closing arguments last month, Mr Sutcliffe said there was an "indisputable similarity between the works". But Sheeran's lawyer said the case against him was "so strained as to be logically unintelligible".
Forensic musicologists were called by both sides to argue the case, giving contrasting views. One said the songs were "distinctly different" but the other argued they contained "significant similarities".
Ian Mill QC, representing Sheeran, said the case had been "deeply traumatising" for the star and his collaborators, while Chokri described the High Court case as "the worst few weeks of my life".