Warner Music Group (search) has agreed to buy Madonna (search) out of Maverick Records, the label she co-founded 12 years ago, to end the legal battle that pitted the music conglomerate against their biggest star.

Madonna's Maverick Records (search) debuted with a flourish and included the multiplatinum debut of Alanis Morissette's "Jagged Little Pill" in 1995. More recently, the company has scored hits with Michelle Branch.

Madonna and partners Guy Oseary and Ronnie Dashev together have owned 60 percent of the company; Warner Music owned 40 percent.

In March, Maverick filed suit against Warner Music and its former parent, Time Warner Inc. (TWX), claiming breach of contract and alleging that they had misstated Maverick's profits and mismanaged the company, costing Madonna and her partners millions of dollars. (An investment group led by Edgar Bronfman Jr. purchased Warner Music Group last year.)

Warner Music filed a lawsuit of its own against Maverick, claiming the company had lost tens of millions of dollars.

In an agreement announced Monday, Warner Music said it would buy Madonna and Dashev, Maverick's chief operating officer, out of their share of the label. Madonna will have no role in the company, while Oseary will keep his share and stay with Maverick as CEO.

Neither side would discuss the financial terms.

The deal does not affect Madonna's own recording contract with the Warner Bros. record label, which is a part of Warner Music and has been her home since 1984. She's sold more than 60 million records with the label.

"It was an effective way of settling the lawsuit," lawyer Bert Fields, who represented Maverick, told The Associated Press on Monday. "It's clean and equitable, and it doesn't have anything to do with her record contract."

"This new joint venture agreement is clearly a win-win for both WMG and Maverick, and we are pleased that Guy Oseary, one of the most successful A&R executives in the industry, is continuing his relationship with both companies," said Lyor Cohen, Warner Music's chairman.

Oseary expressed optimism about his new arrangement with Warner Music. "The new independent spirit at Warner Music is a perfect fit for a stand-alone label like Maverick," he said.

A representative for Madonna, who's on a sold-out concert tour, did not immediately return calls seeking comment.