Apple music headphoneThe announcement, coming 20 days after word of the negotiations leaked, is designed to boost Apple‘s subscription streaming music business and broaden its array of headphones and other audio equipment. Beats co-founders Jimmy Iovine and Dr. Dre will join Apple, the company said without specifying what role they’ll play. The purchase consists of $2.6B with an additional $400M in Apple equity to vest over an unspecified period. “Music is such an important part of all of our lives and holds a special place within our hearts at Apple,” CEO Tim Cook says. “That’s why we have kept investing in music and are bringing together these extraordinary teams so we can continue to create the most innovative music products and services in the world.” This is Apple’s largest acquisition — and a shift for the company that, under Steve Jobs, was determined to build its own brands instead of buying existing ones. Apple plans to continue offering Beats products under its own brand.

But Apple has struggled to keep up with a shift in the market as music listeners have flocked to ad-supported and subscription streaming services and away from purchases. Its ad-supported iTunes Radio has trailed rivals such as Pandora and Spotify. Amazon and Google also are itching to establish themselves in the business. Meanwhile, Billboard reported that Beats’ streaming service, which launched in January, “has been a disappointment” with paid subscriptions in the low-six figures and “soon will face competition on the mobile platform when Sprint begins bundling Spotify with its ‘Framily’ plans.” Apple SVP Internet Software and Services Eddy Cue says that Beats “will make our music lineup even better, from free streaming with iTunes Radio to a world-class subscription service in Beats, and of course buying music from the iTunes Store as customers have loved to do for years.”

Iovine and Dre, who will report to Cue, “are really unique,” Cook told The New York Times. “It’s like finding the precise grain of sand on the beach. They’re rare and very hard to find.” Universal Music says that Interscope Geffen A&M President John Janick will replace Iovine as CEO of the label. Less than two years ago, private equity firm the Carlyle Group invested $500M in Beats for a minority stake that valued the company at more than $1B and took two of the six board seats.