By Kavitha Shastry

Shares of Pandora ($P) soared early Monday after news that satellite radio provider SiriusXM ($SIRI) is buying the company for $3.5 billion.

The all-stock deal represents more than an 11 percent premium to where Pandora shares closed on Friday and brings to an end a long-running will-they-won't-they courtship between the two companies.

Sirius, which reportedly made an offer to acquire Pandora last year but was rebuffed, ultimately invested $480 million in the company, buying preferred stock for a 15 percent stake.

The music streaming service, a pioneer in the industry, has struggled to keep up with competition like Spotify ($SPOT) and Apple Music ($AAPL). In its last earnings report it said it had six million paying subscribers, compared to 83 million for Spotify and an estimated 50 million for Apple.

For Sirius, whose strength is in its car radio business, Pandora represents access to a new user base, albeit a relatively small one.

"This is Sirius recognizing that long term, they need to figure out the internet and this is the best solution," said Rich Greenfield, media and tech analyst at BTIG.

Under CEO Roger Lynch ー who took over the top spot last September, about three months after founder Tim Westergren resigned and just around the time the Sirius investment closed ー Pandora acquired audio adtech company AdsWizz, to deliver more targeted ads and a more personalized experience. The company also teamed up with Snap to allow Snapchat users to share songs seamlessly, even if they didn't subscribe to the same music services.

"We're trying to make [music] a lot more social," Lynch said in an interview with Cheddar at the Mobile World Congress earlier this month.

Shares of Pandora fell to an all-time low just over $4 in January, but have risen more than 120 percent since through Friday's close.

For full interview click here.