Shelley Malil, the actor best known for playing an electronics store clerk in 'The 40-Year-Old Virgin,' was sentenced to life in prison Thursday for the attempted premeditated murder of his ex-girlfriend, Kendra Beebe, RadarOnline.com reports.

Malil was found guilty of attempted premeditated murder and assault with a deadly weapon in September. The jury deliberated less than four hours before making the decision.

The actor will be eligible for parole in 12 years though prosecutor Keith Watanabe said with time already served and good behavior, Malil could be free in as little as nine years.

Beebe was stabbed 20 times by Malil at her San Diego County home in August 2008 after he found her socializing with another man, David Maldonado. Malil said he felt threatened and believed Maldonado was going to kill him.