CUPERTINO, Calif. -- Apple is striking a new chord with a $3 billion acquisition of Beats Electronics, a headphone and music streaming specialist that also brings the swagger of rapper Dr. Dre and recording impresario Jimmy Iovine.

Wednesday's announcement comes nearly three weeks after deal negotiations were leaked to the media. It's by far the most expensive acquisition in Apple's 38-year history, a price that the company is paying to counter a threat posed to its iTunes store.

The price consists of $2.6 billion in cash and $400 million in Apple stock that will vest over an unspecified time period. The deal is expected to close before the end of September.

With $1.1 billion in revenue last year, Beats is already making money and will boost Apple's earnings once the new fiscal year begins in October, Apple CEO Tim Cook said in an interview.

"We have known these guys forever," Cook said of Iovine and Dre. "We've dated, we've gone steady and now we are getting married. This relationship started a decade ago, so we know there is an incredible cultural fit. These two guys have a very rare set of skills. It's like finding a particular grain of sand on the beach. It's that rare."

Iovine, 61, and Dre, 49, will both become key executives in Apple's music divisions, though Cook said their roles haven't been determined yet. Cook said Beats' music streaming service was the main selling point in the deal.

The growing popularity of music streaming services such as Pandora and Spotify has been reducing sales of songs and albums, a business that iTunes has dominated for the past decade. U.S. sales of downloaded songs slipped 1 per cent last year to $2.8 billion while streaming music revenue surged 39 per cent to $1.4 billion, according to the Recording Industry Association of America.

Although Apple broke into streaming with the launch of iTunes Radio last September, the service has not been as popular or as lucrative as the company expected, according to two people familiar with the matter. The people were not authorized to speak publicly about the matter and spoke on condition of anonymity.

Apple is counting on the Beats acquisition to boost its cachet with teenagers and younger adults while trying to remain a leader in digital music -- an industry that looks much different than when Apple reshaped the scene with the 2001 debut of the iPod.

"Apple suddenly has regained its cool," said Sony Music CEO Doug Morris, who was one of the first recording executives to embrace iTunes at Iovine's urging more than a decade ago.

Beats was founded in 2008 by Dr. Dre, now a hip-hop producer, and Iovine, a longtime recording industry executive who is currently chairman of Universal Music Group's Interscope Geffen A&M Records. It now dominates the luxury headphone market. Its equipment also has been a big seller in Apple's stores.

Operating from its Culver City, California, headquarters, Beats commands 62 per cent of the $1 billion U.S. market for headphones priced above $100, according to NPD Group. The gear, which emphasizes bass, also has been endorsed by several star athletes, including San Francisco 49ers quarterback Colin Kaepernick and New Jersey Nets forward Kevin Garnett.

Beats Music, the music streaming subsidiary of the electronics maker, has more than 250,000 subscribers, according to Cook.

The purchase marks Apple CEO Tim Cook's biggest strategic break from the way the Cupertino, California, company was led under co-founder Steve Jobs, who died in October 2011. Jobs favoured smaller acquisitions and didn't believe subscription music plans would be popular. Before Beats, Apple's biggest acquisition had been its $400 million purchase of NeXt Computer, a company that Jobs founded after being ousted from Apple in the 1980s.

Cook said he never considered what Jobs would have thought about the Beats' acquisition. Jobs "told me to do what was right," Cook said. "And I am 100 per cent certain this is what is right. This is one of those things that we will look back upon and say it was meant to be."

Morris, who considers Iovine to be his best friend, believes Cook is making a smart move that will give Apple even more credibility in the music industry.

"It's a game changer because Jimmy is that kind of guy who can change a game," Morris said. "I am not saying he is Steve Jobs, but he is a guy with new ideas and he really knows how to build the bridge between music and technology."

But some analysts question whether Beats will be a good fit for Apple, which makes most of its money selling hardware such as iPhones and iPads.

Forrester Research analyst Frank Gillett says Apple would have been better off developing its own headphones in-house and expanding into music subscriptions through iTunes.

"It's hard to understand why Apple would have to spend $3 billion on a nascent streaming service and a line of bass-heavy headphones," Gillett says.

Yukari Iwatani Kane, the author of "Haunted Empire," an inside look at Apple since co-founder Jobs' death, also sees a disconnect.

"Culturally, Beats is the complete opposite of Apple," Kane says. "It's known for being loud and bold and in your face. It doesn't fit with Apple's understated, discerning brand."

With $150 billion in cash, Apple can easily afford taking a risk on Beats.

Although the Beats deal could give Apple a leg-up in markets where it doesn't have much presence, the quick growth of its music service in a few short months has come at a high cost.

Beats promoted its service with a pricey Super Bowl commercial and other advertising -- spending far more on marketing than larger competitor Spotify, which boasts 10 million paying subscribers worldwide.

Beats Music also offered a 90-day free trial in a deal with AT&T that featured a breakthrough $15-a-month family pricing plan. Some of those who finished the free period ended up cancelling, and there are those still getting the free service, making it unclear how much revenue it generates.

ITunes transformed the music industry in 2003 when the service began selling singles for 99 cents so fans could make their own digital playlists rather having to buy compact discs that also included lots of songs they didn't want.

In recent years, though, consumers have been embracing other music options that cater to their individual tastes even more than iTunes ever did.

A host of free and paid streaming music services such as Pandora, Spotify, Rhapsody, Rdio, iHeart Radio and TuneIn are now threatening iTunes with their crowd-pleasing ability to match songs with the listeners most likely to enjoy them. At the same time, Apple is facing more competition from other song-downloading services run by Google and Amazon, both of whom have been willing to undercut iTunes' prices to gain market share.

The Beats deal also aligns Apple with the push toward higher-quality music, reversing a decline in fidelity as people abandoned vinyl records for CDs and then switched from CDs to MP3s.

Several companies are trying to address the even lower quality of music streamed over capacity-constrained cellular networks. Last month, Spotify announced it was partnering with Sprint and HTC on the HTC One M8 smartphone, which is supposed to stream music in a way that restores some of the fidelity that is lost to digital compression.

Pono Music, a system backed by singer Neil Young, has promised digital files that are CD quality or higher, albeit on a player that will retail for $399 this fall and with a store that is likely to have a limited selection. Yet his Kickstarter fundraising campaign raised $6.2 million from 18,220 backers in just 35 days.

Beats co-founder Iovine is known for focusing on higher quality music, and while Beats' headphones have been criticized for delivering too much bass, the headsets offer an improvement over the ear buds that come with every Apple device. Iovine even disparaged Apple's earbuds at a technology conference last year.