After two years of on-and-off negotiations, Spotify and the world’s biggest record company have finally agreed to a licensing deal that paves the way for Spotify to go public and gives the music industry more flexibility in how new albums are streamed.

Spotify’s agreement with the record company, Universal Music Group — whose hundreds of artists include Drake, U2, the Weeknd and Lady Gaga — is a global, multiyear deal, the companies announced on Tuesday. Spotify’s licensing contracts with all three major record companies had long since expired, and Universal’s deal, the first to be renewed, will put pressure on the other major labels, Sony and Warner, to follow suit.

For Spotify, the deal removes a major obstacle to going public. The streaming music company, which has been valued by investors at more than $8 billion, has by far the largest service of its kind, with 50 million paying subscribers and at least another 50 million who listen to music on Spotify’s free tier, which has advertising. But without contracts in place guaranteeing the presence of the music on its service — Universal controls around a third of all music sales around the world — the company would have difficulty attracting investors on the public markets.