Twitter has invested about $70 million in the streaming music service SoundCloud in a deal that may help both companies attract more users.

Jack Dorsey, Twitter’s chief executive, confirmed that the company’s investment in a statement to the technology news site Recode on Tuesday.

He did not specify the amount, and a spokeswoman for Twitter declined to comment. But the figure was confirmed by a person who had been briefed on the deal.

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