Germany's Constitutional Court - the highest court in the country - has held that use of sampling clips in hip hop music is permissible if it is part of a new composition that does not stand in direct competition to the sample work, and does not hurt the music patent owners financially.
Hip hop producer Moses Pelham used a two-second sample of music from German electronic pioneers Kraftwerk.
AFP news says problems arose when rap artist Sabrina Setlur's 1997 song "Nur mir" used the short drum sequence repeatedly. The sequence originally came from Kraftwerk's 1977 song "Metall auf Metall".
Kraftwerk lead singer Ralf Hueffer took action in the Federal Court of Justice over the rights to the sequence against Pelham.
A report by the BBC says that Hueffer was successful initially, with the Federal Court of Justice ruling that the song should no longer be promoted as it amounted to copyright infringement.
An appeal to Germany's highest court has gone the other way, with the court sending the case back to the Federal Court of Justice to reassess.
In the appeal Pelham asserted that his artistic freedom had been infringed.
Pelham's argument was that sampling is common practice in the hip hop genre, and he told the court that he works from a set of "interesting music sequences" and was not aware that the sample came from Kraftwerk.
AFP says that in its decision, the Constitutional Court said sampling was one of the "style-defining elements" of hip hop.
"The Court said that imposing royalties on composers could be crippling as copyright owners can demand any amount, or they can simply reject the request for usage.
"Composers should be allowed to create works without any financial risks or restrictions in the creative process, argued the court.
"Sampling is therefore permitted if it is part of a new composition that does not stand in direct competition to the sampled work, and does not hurt the music patent owners financially."