Troubled former television host Andrew O'Keefe has been granted bail in the NSW Supreme Court to attend a rehabilitation centre.
The 50-year-old appeared from Silverwater jail on Monday via video link and thanked the judge following multiple failed attempts at securing bail.
The Former Seven Network presenter nodded quietly throughout after being reprimanded in previous appearances for outbursts in court.
Justice Robert Allan Hulme said O'Keefe had a long-standing and significant drug problem combined with mental health issues that were trauma-related.
To combat his substance abuse that includes cocaine, ice and cannabis, he proposed a stint in rehab for up to 12 months.
"It offers the applicant an opportunity to address issues that have led to ... a significant descent into an erratic and chaotic lifestyle," Justice Hulme said.
"Which is foreign to that which he had experienced until well into his middle ages."
He accepted that the former Deal or No Deal host experienced greater hardship in custody than someone typically on remand.
The court was earlier told O'Keefe was subject to bullying and taunts from prison officers due to his high profile and had spent weeks in isolation.
O'Keefe was charged in January with two counts of intentionally choking a person, three of common assault, and assault occasioning actual bodily harm.
Police say O'Keefe grabbed a 38-year-old woman by her throat, pushed her to the ground, and punched and kicked her in his Sydney CBD unit.
O'Keefe claims he acted in self-defence.
At the time he was charged O'Keefe was already on bail for a separate alleged incident of assault after being arrested in September.
Justice Hulme said the charges were serious and that he could not describe the crown case as weak.
O'Keefe must comply with several orders including that he not drink alcohol or take any drugs not prescribed by a doctor, and that he stays at the rehab centre until required.
"Thank you Your Honour," O'Keefe said before also thanking the Crown and his defence counsel.
He must also attend his next court hearing on June 20.
In June last year the former lawyer avoided conviction for domestic violence charges after they were dealt with under the NSW Mental Health Act.
1800 RESPECT (1800 737 732)
Lifeline 13 11 14
Australian Associated Press
Sign up for our newsletter to stay up to date.