Denise Richards' temporary custody of Brooke Mueller's four-year-old twins has been extended.

The 'Twisted' actress, 42, was granted permission to keep the 35-year-old socialite's sons, Bob and Max - who were removed from Brooke's home on Thursday (02.05.13) by the Los Angeles County Department of Children and Family Services when she was placed under an involuntary psychiatric hold in hospital - in her care for the moment, as Brooke undergoes treatment for ''prescription drug abuse.''

A source told gossip website TMZ.com that Denise and her ex-husband Charlie Sheen, who is the boys' father, put on a united front at an emergency court hearing on Tuesday morning (07.05.13) where a judge poured over what sources say is a shocking report about the conditions in Brooke's home.

The twins were also in court, along with Brooke's lawyers Lori Howe and Angela di Donato, and Charlie's lawyers Mark Gross and Elise Greenberg.

A source previously said: ''Denise isn't required to be in court, but she plans on being there to convey to the judge how serious she is about being Bob and Max's temporary guardian.

''Social workers are going to ask the judge to extend Denise's custody of the boys for the next 30 days, at least.''

Brooke - who is Charlie's third ex-wife - has reportedly given her blessing for Denise - who has daughters Sam, nine, and Lola, seven, with the 'Anger Management' star, as well as adopted daughter Eloise, two - to look after Bob and Max.

The source added: ''Bob and Max won't be placed back in Brooke's care until officials feel that they will be safe in her care. Brooke is going to have jump through hoops to get them back. Going to rehab is not going to be enough. She has been nineteen times in the past, and currently getting treatment for the twentieth time.

''The boys are thriving in Denise's house, and since Charlie lives in the same gated community, he has been spending more time with them.''