British pop star Ed Sheeran has won the copyright lawsuit for his hit "Shape of You".

The London High Court ruled on Wednesday that the 31-year-old did not plagiarize parts of the melody from another song.

Judge Antony Zacaroli said Sheeran "neither intentionally nor subconsciously" took over parts of Oh Why.

The musicians Sami Chokri and Ross O'Donoghue had accused Sheeran of having taken parts of the melody of their song "Oh Why".

Her attorney, Andrew Sutcliffe, said in court that Sheeran was undoubtedly "very talented, he's a genius."

But sometimes he is also a thieving "magpie": He borrows the ideas of others for his songs and denies it when he thinks "that he can do it with impunity".

Sheeran and his two co-authors, Steven McCutcheon and John McDaid, denied the allegations.

During the trial, Sheeran sang and hummed tunes, among other things, to refute the allegations.

Sheeran co-wrote "Shape of You" with McDaid and McCutcheon, and the song released in 2017 is considered his biggest hit to date.

With more than three billion views, it is the most streamed song on Spotify.