Two years ago Twitter thought about buying SoundCloud, but ended up walking away from the music service.

Now Twitter has bought a piece of SoundCloud instead.

Twitter has invested around $70 million in the music service, as part of a round that should end up in the $100 million-range, according to sources familiar with the deal. The round is expected to value SoundCloud at about $700 million — the same value that investors placed on the company in 2014, when it raised $60 million; since then it has also raised a debt round.

Twitter CEO Jack Dorsey wouldn’t comment on the specifics of the company’s investment, but confirmed that Twitter now owns a stake in SoundCloud.

"Earlier this year we made an investment in SoundCloud through Twitter Ventures to help support some of our efforts with creators," he said. "They've been great partners of ours over the years and their community-supported approach mirrors ours in many ways."

In a statement, a SoundCloud spokesperson said, "We can confirm that Twitter has made an investment in SoundCloud. Both companies facilitate and inspire contemporary culture to happen in real time while reaching millions of people around the world. This investment will enable SoundCloud to remain focused on building value for creators and listeners alike, and to continue the global rollout of many company initiatives such as our recently launched subscription service, SoundCloud Go."

It’s unclear whether the Twitter investment is part of a strategic partnership, but that would make sense: Twitter might view via an integration with SoundCloud as a way to increase growth and engagement, and SoundCloud may look at Twitter as a way to promote its newly launched subscription service, which is crucial to the company’s plans.

And both companies could use some help. Twitter has been punished by Wall Street for its inability to add users at a rapid clip; SoundCloud’s flat valuation indicates that investors are also worried about its own growth prospects.

Jack Dorsey and civil rights activist DeRay Mckesso on Twitter and political causes