Time-Warner, the world's largest media company, has agreed to sell its Warner Music business to an investor group headed by Canadian businessman Edgar Bronfman, Jr.

Under the $2.6 billion deal, Time-Warner will get cash and the option to buy up to a 20 percent stake in the business.

Warner Music is home to Madonna and REM among many other artists.

EMI group had been in talks with a rival bid for Warner.

The deal comes as the industry is in a three-year sales slump blamed on online piracy of recorded music.