Brooke Mueller and Charlie Sheen Brooke Mueller and Charlie Sheen

Despite refusing a court-ordered drug test, Brooke Mueller will maintain custody of the twin boys she shares with ex Charlie Sheen, the New York Daily News reports.

Sheen wanted to remove Mueller's legal and physical custody of their 2-year-old sons, Bob and Max. But in a hearing Tuesday, judge Hank Goldbert decided to keep the couple's private custody agreement the same.

Report: Brooke Mueller back in rehab

Mueller reportedly checked herself into rehab after refusing a court-ordered drug test. The tests are part of her child-custody agreement with Sheen and refusal constitutes as a failed test. She's been in rehab twice in the past year.

Sheen took a detour from his "Violent Torpedo of Truth" tour to visit California for the custody hearing. After losing his bid to get the twins back, Sheen hopped on a plane again to make his Washington, D.C. concert, scheduled for 8 p.m. Tuesday. (Apparently, he'll be late.)

Sheen and Mueller's divorce was finalized in February and becomes official May 2.