Charlie Sheen and Denise Richards went through a very public and nasty divorce in 2005 but now the couple is in a peaceful place.

"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," the actress said during her appearance on HuffPost Live on Tuesday. Watch the interview here. 

"Just because we are divorced, the hostility and all that is not fun and it's not healthy for either of us or the kids so that's why it's important," she added.

The actress also explained what made her relationship with Sheen take a turn for the better.

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

Sheen filed for divorce from his third wife Brooke Mueller in 2010, as reported by Fox News.

Richards was also recently granted temporary custody of Sheen's twin boys with Mueller because of their mother's treatment for prescription drug addiction, according to HollyScoop.

The Twisted actress went on to say, "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 was in a different place later on, which is good. 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."

She also doesn't blame herself for their turbulence following the divorce.

"I never went out of my way to try to make things bad, with the kids its the best thing for us to get along," she added.

Richards, who has two daughters with Sheen named Lola Rose and Sam, also said that being under public scrutiny is what made her divorce from Sheen harder.

"What people's perception of and what was really going on was very different," Richards said about how the media portrayed that difficult time in her life.