Jimmy Iovine, Tim Cook, Dr. Dre, and Eddy Cue

It’s official. Nearly three weeks after initial reports, Apple has agreed to acquire Beats Electronics and Beats Music, founded in 2008 by Dr. Dre and Jimmy Iovine.

Apple is acquiring the companies for a total of $3 billion, consisting of $2.6 billion in cash and $400 million in Apple stock.

The deal, which is expected to close before the end of September, is the most expensive acquisition in Apple’s 38-year history, and includes the subscription streaming music service Beats Music, and Beats Electronics, maker of Beats headphones, speakers, and audio software.

As part of the acquisition, Dre and Iovine will both become key executives in Apple’s music divisions.

“We have known these guys forever,” Apple CEO Tim Cook told the AP. “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.”

Dr. Dre was seen celebrating the news earlier this month in a video posted online.

“The first billionaire in hip-hop right here from the motherfu**ing West Coast,” declared Dre.

According to Forbes, the deal would bump Dre’s net worth to around $800 million. While not quite enough to land on the Forbes 400, it would easily make him hip-hop’s wealthiest mogul, topping current champ Diddy by $100 million.