Apple has confirmed it will buy headphone maker and music-streaming service provider Beats Electronics.
The deal is worth a total of $3bn (£1.8bn), and is thought to be Apple's largest acquisition to date.
As part of the acquisition, Beats co-founders Jimmy Iovine and Dr Dre will join the technology firm.
Apple boss Tim Cook said the deal would allow the firm to "continue to create the most innovative music products and services in the world".
In a statement, Apple said it is paying an initial $2.6bn (£1.6bn) for Beats, and approximately $400m (£239m) "that will vest over time".
Beats was founded in 2008 by music producer Jimmy Iovine and hip-hop star Dr Dre and until recently was best known for its headphones.
It started a subscription-based music streaming service earlier this year.
Apple has its own iTunes store, the world's largest music download service, and launched iTunes Radio last year.
But despite having been an early pioneer of digital music, the Californian firm has been facing increased competition from subscription services such as Spotify, Pandora and Rdio.
However, Beats' music service only has about 250,000 paying subscribers, compared with Spotify's 10 million.
'It's the people'
The deal with Beats also marks a departure for Apple, which has a reputation for developing new products in-house, rather than buying up smaller firms - a method preferred by rivals Google.
But in an interview with the New York Times, Mr Cook hinted that Beats' founders may have been part of the attraction.
"Could Eddy's team [Eddy Cue, Apple executive in charge of iTunes] have built a subscription service? Of course," he told the newspaper.
"You don't build everything yourself. It's not one thing that excites us here. It's the people. It's the service."
"These guys are really unique," Mr Cook added. "It's like finding the precise grain of sand on the beach. They're rare and very hard to find."
The Apple boss also said that Dr Dre and Mr Iovine would be coming up with "products you haven't thought of yet".
'Everyone is puzzled'
However some analysts remain baffled by the acquisition.
Technology writer Benedict Evans tweeted: "If you think Apple's lost it, Beats deal is confirmation. If you don't, it's… perplexing. Few really convincing rationales."
Beats co-founder Jimmy Iovine, who made his name as chairman of the Interscope Geffen A&M record label, welcomed the deal.
"I've always known in my heart that Beats belonged with Apple," he said.
"The idea when we started the company was inspired by Apple's unmatched ability to marry culture and technology.
Apple analyst Jim Dalrymple hinted that it may be Mr Iovine's talent that the technology firm is after.
Writing on his website The Loop, Mr Dalrymple said: "In my opinion, Jimmy is going to play an important role going forward.
"Maybe not that you always see, but he'll be there".
As well as headphones, Beats sells earphones and portable speakers, and has even developed partnerships with carmakers and computer manufacturers to include its BeatsAudio software technology in their products.
The company's flagship products have also received several celebrity endorsements, with stars including Lady Gaga, Lil Wayne and Nicki Minaj designing their own customised Beats headphones.
Subject to regulatory approvals, Apple said it expects the deal to close in the fourth financial quarter of this year.