A Redwood City man convicted of attempted to rape his teacher at knifepoint in the school parking lot was sentenced Friday to eight years to life in prison for what a judge called a “horrifying experience.”

David Andres Velasquez, 22, but 19 at the time of the Jan. 23, 2012, attack, was “motivated by an unhealthy sexual motivation to live out some twisted sexual fantasy,” Judge Lisa Novak said before imposing sentence.

During trial, Velasquez’ defense claimed the entire incident was a prank. Jurors deliberated an hour and a half Oct. 2 before convicting Velasquez of kidnapping for sexual assault, assault with the intent to sexually assault, false imprisonment and making criminal threats, all with the added enhancement of using a knife. The kidnapping conviction is what carried the life term.

The sentence is a “very good outcome,” said District Attorney Steve Wagstaffe who added that the probation report prepared for the court indicated the victim was left extremely traumatized.

The teacher was in the parking garage at Summit Preparatory Charter High School on Broadway around 5:15 p.m. when a man jumped from bushes near the lot and grabbed her from behind. He held a knife to her side and ordered her to go to her car and climb in. When he threatened to kill her if she did not comply, the woman reported recognizing his voice as a student.

She intentionally dropped her keys to buy time but he pushed her to the ground, pried her legs apart with his elbow and laid on top of her. Another woman entering the parking lot saw the attack and screamed, causing him to flee. Police identified the attacker as Velasquez and arrested him later that night.

Velasquez has been in custody on $1 million bail. He has credit of 996 days leaving him roughly five years left to serve before being eligible for parole.

Defense attorney Jonathan McDougall did not return a call for comment.