Updated

An actor who appeared in "The 40-Year-Old Virgin" says he was flailing with a knife when he stabbed his ex-girlfriend last summer because he thought he was being attacked.

Shelley Malil is accused of stabbing Kendra Beebe 23 times in the backyard of her San Diego County home. The Indian-born actor testified Monday he understands he's responsible for Beebe's wounds but doesn't remember inflicting each one.

The San Diego Union-Tribune reports that Malil told jurors he started flailing with a knife because he was struck in the back of the head in Beebe's yard and was fighting back. He says he found the knife at the home and grabbed it when he saw Beebe with a man he didn't recognize.

Malil could face 21 years to life in prison if convicted of premeditated attempted murder and other charges.

___

Information from: The San Diego Union-Tribune, http://www.signonsandiego.com