The constitutional court ruled that if the impact on the usage rights of the intellectual property owner is "negligible, then artistic freedom overrides the interest of the owner of the copyright".
At the heart of the dispute is a short drum sequence looped repeatedly in the song "Nur mir" (Only Me) by Sabrina Setlur, also famous for her past relationship with German former tennis star Boris Becker.
The sequence originally came from Kraftwerk's 1977 release "Metall auf Metall" (Metal on Metal).
Since the release of "Nur mir" in 1997, Kraftwerk's lead singer Ralf Hütter has been battling over the rights of the sequence against the producer Moses Pelham.
Producer Moses Pelham was in court in Karlsruhe on Tuesday to hear the verdict. Photo: DPA
The electronic music veterans had already won German court backing for damages and an injunction over the song, but Pelham and Setlur appealed and brought the case to the country's highest court claiming it infringed artistic freedom.
At the court hearing in Karlsruhe in November, Hütter insisted that the commandment "thou shalt not steal" applied also to music.
But Pelham argued that sampling is common practice in the hip hop genre.
He said he works from a set of interesting music sequences and was not aware then that the sample in question stemmed from Kraftwerk's work.
Common practice in hip hop
Germany's constitutional court acknowledged this common practice in hip hop in overturning the previous court verdict that was in favour of Kraftwerk.
It noted 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 suffer any 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, the German court found.
Hip hop artists are particularly vulnerable to such copyright rows, as sampling is an integral part of their music although they are usually required to seek permission to use elements of recordings.