Denise Richards will keep custody of Charlie Sheen's twins for the rest of the year.

The 42-year-old star was granted temporary custody of her ex-husband and Brooke Mueller's four-year-old twins, Bob and Max, back in May after Brooke's drug use spiraled out of control.

The boys will now be allowed to remain with Denise - who also has two children, Lola, eight, and Sam, nine, from her marriage to Charlie, as well as adopted daughter Eloise, two - while Brooke proves she can stay sober for the sake of her kids.

A source told RadarOnline.com: ''[Child protective services] recommended that while Brooke continues to get treatment for her drug addiction, the twins continue to live with Denise for the rest of the year.

''Brooke is going to need to demonstrate during that time a commitment to her sobriety and recovery, and not have any dirty drug tests. Denise is thrilled to take care of the twins and hopes to make it permanent. The boys are doing extremely well in her care.''

Brooke, 35, was placed on involuntary psychiatric hold following a drug overdose in May, after which she checked in for her 21st stint in rehab to cure her addiction to crystal meth.

'Anger Management' star' Charlie is reported to have offered to pay child support to help Denise look after his children, but she turned it down.

A source recently said: ''Charlie is extremely generous, and wanted to make sure having the twins in Denise's care didn't place a financial strain on her.

''Denise was thankful for the offer, but declined because she has the financial means to take care of them herself. She isn't doing this for the money.''