VISTA, Calif. (CBS/AP) "40-Year-Old Virgin" actor Shelley Malil was sentenced Thursday to life in prison with the possibility of parole in 12 years for stabbing his ex-girlfriend Kendra Beebe more than 20 times after he stopped by her southern California home and found her with another man.

Malil, 45, was sentenced by San Diego County Superior Court Judge Harry Elias three months after a jury convicted the actor of attempted premeditated murder and assault with a deadly weapon.

The actor testified at trial that he visited the victim Beebe at her San Marcos home in suburban San Diego in August 2008 to apologize for taking personal items from her house and to warn that he e-mailed sexually graphic photos of the couple to her co-workers. Malil became angry when he found Beebe drinking wine with another man and stabbed her with a kitchen knife.

Beebe suffered punctured lungs and wounds to her neck, back, chest and arms, but survived the horrific attack.

Seated before the court, Malil expressed regret for stabbing Beebe and claimed he wanted to go to prison.

"I want to do whatever I need to do to make sure I make right from the wrong that I did," he said. "Kendra Beebe did not deserve anything that happened to her...I can't even begin to imagine what she has been through," he added.

Before the sentencing, Beebe also spoke to the court about the physical and emotional pain she suffered.

"Despite the stab wounds he inflicted, I am alive," she said, going on to say Malil's testimony had not been credible.

"During the course of the trial it became clear he was an actor, but not a very good actor at that. His testimony was lie after lie after lie," she said.

The sentence makes Malil eligible for parole in 12 years, but prosecutor Keith Watanabe said Malil could be freed in as few as nine years taking into account time already served and good behavior.