Apple Music goes live tomorrow, despite a run-in with Taylor Swift over royalties ahead of the launch.

The new service is being offered free to users for the first three months, but the pop sensation stepped in and threatened to withhold her music when it emerged that no royalties would be paid to artists for that period.

Following Swift's public opposition, Apple changed its policy and has reached an agreement with independent record labels to join the service too.

The deal means Apple Music will now be well-placed to take on rival service Spotify, which recently announced it had reached 20 million paid subscribers, a number Apple hopes to cut into by opening Music to everyone at launch.

Swift has agreed to let Apple Music be the only service to stream her album 1989. She withdrew her music from Spotify in November over the existence of a free version of the service.

After the three-month trial period Apple Music will cost 9.99 dollars (£6.37) a month in the US - the same as the paid tier of Spotify - while a UK price is yet to be confirmed.

As well as the more than 30 million songs in its iTunes library, Apple Music will also contain a 24-hour radio station called Beats 1 that is being anchored by former BBC Radio One DJ Zane Lowe, and a social area called Connect, where artists can share images, video, sound clips and other media with their fans.

At the unveiling of the new service earlier this month, Apple said: "Apple Music is a revolutionary streaming music service, a pioneering worldwide live radio station from Apple broadcasting 24 hours a day and a great new way for music fans to connect with their favourite artists."

The app, which will also become the first Apple-designed software to make the move to Google's Android operating system, is the result of Apple purchasing Beats Audio last year. The Dr Dre-founded company's headphones are now on sale in Apple retail stores, and Apple Music is set to be the replacement for the Beats Music app.

Beats co-founder Jimmy Iovine said: "Apple Music is really going to move the needle for fans and artists.

"Online music has become a complicated mess of apps, services and websites. Apple Music brings the best features together for an experience every music lover will appreciate."

Apple Music is set to be rolled out as an update to the Music app that comes built into every iPhone and iPad. The app will also work on Apple Watch, as well as on Mac desktops and PCs.