Denise Richards credits Charlie Sheen's split from Brooke Mueller with saving their friendship.

The 42-year-old actress divorced the 'Anger Management' star in 2006 after four years together and - although she admitted it is ''awful'' - she claimed his failed third marriage brought them closer together.

She said: ''This is awful to say, but it's true. When his third marriage started to fall apart, he and I started to become friendly.''

Charlie and Brooke married in 2008 and their divorce was finalised in 2011.

Now, Denise is pleased her and the 47-year-old actor - who together have daughters Lola, eight, and Sam, nine.- have really been able to focus on making their children happy.

She added: ''In the last few years, things have gotten really great with us.

''We're very close and we're good friends, which is great because it's great for our kids.''

She also revealed Charlie ''sees the benefit'' of the former couple trying their hardest to get along for the sake of their daughters rather than forcing them ''to be around'' constantly arguing parents.

She explained: ''From day one, I've always wanted to keep the kids a priority and suck it up for them, but it takes two people to do that.

''He sees the benefit, too, that when we get along, it's good for the kids. It's not fair to them to be around parents who can't stand each other.''

Denise - who also has an adopted little girl Eloise, 23 months - is currently acting as a temporary legal guardian for Charlie and Brooke's twin sons, Bob and Max.

She was granted custody of the four-year-old boys after child protective services removed them from Brooke's home last month.

The 35-year-old socialite is currently being treated for addiction at the Betty Ford Clinic in California.