Spotify and Ministry of Sound have reached an agreement to end a legal battle over playlists.

The dance music label claimed playlists compiled by Spotify users based on its compilation albums breached copyright.

Ministry of Sound attempted to force Spotify to delete the playlists.

The two companies issued a joint statement saying they had reached an "amicable agreement".

Lohan Presencer, CEO of Ministry of Sound Group, said: "Ministry of Sound welcomes Spotify's willingness to work together to reach an agreement."

It is understood that the playlists will not be deleted from Spotify, but removed from its search engine.

Spotify and Ministry of Sound are pleased to have reached a resolution on amicable terms James Duffett-Smith Spotify

Users will also not be allowed to "follow" the playlists.

"Spotify and Ministry of Sound are pleased to have reached a resolution on amicable terms," said James Duffett-Smith, Head of Licensing Business Affairs at Spotify.

Individual tracks in the playlist were correctly licensed, but the legal action was based on the order in which they were compiled being subject to copyright.

Ministry of Sound claimed that law protected the "the expertise and creative effort involved" in compiling albums.

Titles released by the label include The Sound Of Dubstep Classics and Ibiza Annual 2013.

Ministry of Sound does not own the copyright to many of the tracks on its compilations, the majority of which have been licensed from other record labels.

Spotify allows subscribers to listen to the 20 million songs in its catalogue and use them to create their own playlists.

The service, which began in Sweden, now has 24 million users in 28 countries.

Ministry of Sound has sold more than 50 million albums since it was founded with the opening of an nightclub in London in 1991.