Former soap opera actor Dylan Patton has been charged with felony possession of cocaine with the intent to sell. Credit: Frazer Harrison/Getty

Dylan Patton has been formally charged with selling cocaine out of his family home in Agoura Hills, Calif. The felony complaint alleges the former Days of Our Lives star sold the illegal drug within 1,000 feet of Sumac Elementary School.

According to TMZ, local police raided the soap opera actor's home on Tuesday, May 14, just days after Patton sold cocaine to an undercover cop. Once officers obtained a search warrant, they raided Patton's house and took the 20-year-old into custody.

As of Thursday, May 16, Patton was still in jail; his bail was set at $30,000. If convicted, prosecutors said the Daytime Emmy Award nominee faces up to nine years in state prison.

Patton played Will Horton on Days of Our Lives from 2009 to 2010. When the character's story changed, he was replaced by actor Chandler Massey of Army Wives and One Tree Hill fame.