Denise Richards almost missed out on the starring role in new drama 'Socio' because of her relationship with ex-husband Charlie Sheen.

The actress - who has two daughters, Sam, eight, and seven-year-old Lola with the controversial actor - won the lead part in the pilot of the hour-long family drama but bosses didn't want her to audition because they felt her association with Charlie wouldn't be good publicity.

A source said: ''ABC Family didn't want to even consider her for the role, and actually turned her down for an audition [because of Sheen]. Press like that can hurt an actress.''

However, Denise - who stood by Charlie during his crazy drug-fuelled 'lost year' between late 2010 and 2011 - impressed bosses so much they decided to give her the role of the mother of Danny Ryder, who's freed from jail after serving time for murdering his aunt.

The source added: ''She killed it.''

Denise's character is described as a mother ''who once ruled the town's social scene but now struggles to put on a brave face with her son's return.''

An insider added to the New York Post newspaper: ''Denise will bring great depth to the role of Danny's mother and is a wonderful addition to the cast. ABC Family is thrilled to have her as part of the drama pilot.''

Denise - who also has a 17-month-old adopted daughter, Eloise - split from Charlie in 2006 and despite a messy divorce, they put their problems behind them for the sake of their daughters.