By Mike Bruno
Updated September 17, 2010 at 12:35 PM EDT

Actor Shelley Malil (The 40-Year-Old Virgin) was found guilty of attempted murder on Thursday for stabbing his girlfriend more than 20 times in 2008, People reports. Malil claimed he accidentally stabbed Kendra Beebe in her San Marcos, Calif., home, mistaking her for an attacker in the dark. Witnesses testified that the two had an argument at the beach the day before the stabbing.

The actor’s lawyer argued for attempted voluntary manslaughter, not murder, saying his client acted in the heat of passion when he arrived at Beebe’s home and found her in the backyard with another man.

Malil will be sentenced on Nov. 18 and faces 21 years to life in prison.