Apple will make the most expensive acquisition in its history, after confirming a deal to buy Dr Dre's Beats Electronics for $3 billion.

The luxury headphone brand and its music streaming service was co-founded by music mogul Jimmy Iovine and US rapper and producer Dr Dre, who reportedly called himself the "first billionaire in hip hop".

Technology giant Apple is stumping up the huge price tag, by far the highest it has ever paid in a takeover, to counter a threat posed to its iTunes store.

The announcement comes three weeks after deal negotiations were leaked to the media.

Apple chief executive Tim Cook said the main selling point of the deal was Beats Music, the music streaming subsidiary of the electronics maker which launched this year and has more than 250,000 subscribers.

Sales of songs and albums online, a business dominated by iTunes for the past decade, have started to reduce as the popularity of music streaming services such as Pandora and Spotfify grows.

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 sources.

Apple is counting on the Beats acquisition to boost its popularity with teenagers and younger adults while trying to remain a leader in the changing digital music industry.

Beats was founded in 2008 by Dr Dre and Mr Iovine, a veteran record industry executive who is currently chairman of Universal Music Group's Interscope Geffen A&M Records. It now dominates the luxury headphones market.

Mr Cook said: "Music is such an important part of all of our lives and holds a special place within our hearts at Apple.

"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."

Mr Iovine said: "I've always known in my heart that Beats belonged with Apple.

"The idea when we started the company was inspired by Apple's unmatched ability to marry culture and technology. Apple's deep commitment to music fans, artists, songwriters and the music industry is something special."

He added that Beats earned £1.1 billion in revenue last year and will boost Apple's earnings once the new fiscal year begins in October.

Mr Iovine, 61, and Dr Dre, 49, will both become key executives in Apple's music divisions.

The sale consists of $2.6 billion in cash and $400 million in Apple shares. The deal is expected to be completed before the end of September.

Apple's biggest acquisition had previously been its 400 million dollar purchase of NeXt Computer.

The purchase marks Mr Cook's biggest strategic break from the way the company was led under co-founder Steve Jobs, who died in October 2011.

Mr Jobs favoured smaller acquisitions and believed subscription music plans would prove to be unpopular.

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.

Yukari Iwatani Kane, the author of Haunted Empire, an inside look at Apple since Mr Jobs' death, sees a disconnect.

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

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

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.