Beats co-founders Jimmy Iovine and Dr. Dre will join Apple as part of the deal. The acquisition had been rumored earlier in the month and was made official Wednesday afternoon. Apple expects to close the purchase in the fourth quarter, it said.

Beats may be best known for its headphones and other audio gear, but the company's streaming service is probably Apple's main reason for the acquisition, by far the biggest in its history.

Apple's iTunes service still dominates the music downloads business, but downloads have been going out of style with the growing popularity of streaming services such as Spotify and Pandora.

Revenue from music downloads declined by 1 percent last year, to $2.8 billion, while revenue from paid subscription services increased 57 percent to $628 million, according to recent figures from the recording industry.

That meant streaming services accounted for 21 percent of music industry revenue last year, or just over a fifth up from just 3 percent of revenue in 2007.

Apple got in on the streaming game last September by launching iTunes Radio, a free service supported by advertising. It apparently thought the fastest way into the paid subscription game was an acquisition.

The addition of 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," Eddy Cue, head of Apples Internet Software and Services group, said in a statement.

Iovine, who founded Interscope Records before starting Beats with Dr. Dre in 2006, claimed he had "always known in my heart that Beats belonged with Apple."

Of the $3 billion purchase price, Apple will pay $2.6 billion up front, and approximately $400 million will vest over time.