(Los Angeles) CNN — The judge overseeing Chris Brown's probation in his Rihanna beating case has ordered the singer to immediately enter a rehab program.
Brown, who was arrested on an assault charge in Washington, D.C., last month, still faces a possibly probation violation charge that could send him to prison.
The singer sat nervously in a Los Angeles County courtroom, holding girlfriend Karrueche Tran's hand as he waited while his lawyer, Mark Geragos, met privately with the judge and prosecutor before his hearing began Wednesday afternoon.
Brown's freedom has been in question since he was arrested on a sidewalk near the White House after allegedly punching a man.
The probation imposed when he pleaded guilty to a felony charge in the 2009 attack on Rihanna -- his girlfriend at the time -- requires that he stay out of legal trouble.
The lawyers and judge emerged from chambers with a deal, which required Brown to spend the next 90 days in a court-approved treatment facility.
Los Angeles County Deputy District Attorney Mary Murray told the judge she still reserved the right to ask for Brown's probation to be revoked on the D.C. arrest.
Los Angeles County Superior Court Judge James Brandlin ordered the probation officer to provide a detailed report about that incident, with that report expected to be presented when Brown returns to court on December 16.
Brown voluntarily entered a rehab center on October 28, a day after he was released from a Washington jail. He checked out about two weeks later, but his representative said he would continue in the program as an outpatient.
"His goal is to gain focus and insight into his past and recent behavior, enabling him to continue the pursuit of his life and his career from a healthier vantage point," representative Nicole Perna said when he entered.
Brown will leave the rehab center three days a week to work eight-hour shifts of community labor so that he can complete the 1,000 hours of work still remaining in his punishment for the attack on Rihanna.
He may also travel to Washington for a court hearing Monday in the assault case there, the judge said. His lawyer said he would try to get the hearing delayed.