Charlie Sheen has avoided contempt of court charges.

The 'Anger Management' actor had been ordered not to speak about ex-wife Brooke Mueller and their custody battle over twin sons Bob and Max, but ranted about the situation on Twitter, hours after the ruling had been made on Friday (08.11.13).

However, after the judge presiding over the case called an emergency meeting yesterday (12.11.13) to discuss the situation, he ruled it would not be in the best interests to proceed with a contempt action as it could turn into a ''circus'', TMZ reports.

Instead, Charlie's lawyer agreed his client will stay quiet on the matter in future.

The outspoken actor lashed out after Brooke's brother was given temporary custody of the boys, meaning they could move back into their mother's home, prompting Charlie to label the judge an ''anus brain'' and staff at Los Angeles Department of Children & Family Services (DCFS) ''lascivious and incompetent.''

He also wrote: ''So lemme see if I got this straight ... my twin boys are now in harm's way and in grave danger, being 'raised' by a gaggle of incompetent and lascivious marionettes all ruled and fooled by an Adderall snorting husk called Brooke. (sic)''

At the time, the 48-year-old actor insisted he would defy the gagging order for the sake of his children.

He added: ''If this means being jailed for loving and trying to protect my children, then go for it.

''I have as many friends on the inside as I do out here. My passion WILL NOT be silenced. You are all now standing in my way. I'd recommend a shift in your geography. (sic)''

This comes after another of Charlie's ex-wives, Denise Richards, renounced her temporary custody of the twins because she felt they were exhibiting ''violent behaviour'' towards her daughters.