A Redwood City high school student accused of trying to rape a female teacher at knife point in a school parking lot said the whole incident was a "senior prank" intended to scare her.

David Velasquez, now 21, testified in his own defense today in San Mateo County Superior Court, where he is on trial for assault with intent to commit rape, kidnapping with intent to rape, false imprisonment and making criminal threats.

On Jan. 23, 2012, Velasquez testified he waited around the campus at Summit Preparatory Charter High School for one of his teachers -- referred to during the trial as "Ms. Doe" -- who was walking to her car at around 5:15 p.m.

Velasquez, who was wearing a scarf around his face and no shoes "to be quiet," said he grabbed Ms. Doe with his left arm, held a knife to her side and "guided her" towards her car.

"The goal of the prank was to scare her and make her open the back door of the car," Velasquez said.

Velasquez testified that the prank was meant to end if he was able to force his teacher into the back of the car, and that he never intended "to do anything physical," as prosecutors allege.

During the assault, the victim tried to escape Velasquez six or seven times, and Velasquez admitted to deputy district attorney Tricia Povah that Ms. Doe seemed "shocked."

Povah alleged that Velasquez forced the victim to the ground, held her down and tried to pry open her legs.

Velasquez said he fell on top of her "by accident" and was trying to get his knife out from in between them when he held her down.

A second teacher arrived at the scene and yelled at Velasquez to stop, prompting him to flee.

The whole incident lasted between five and eight minutes,

according to Velasquez and prior testimony from the victim.

Velasquez was arrested later that night at his Redwood City home.

Asked by Povah if he was attracted to his teacher, Velasquez said that he wasn't, even though he admitted that he had kept a half-dozen photographs of her saved on his computer in a file called "Young Hotties."

Velasquez admitted he had obtained a photograph of the teacher and her husband, removed the image of the husband, and inserted an image of a penis ejaculating on her face.

The defendant said he was under the influence of marijuana when he made the picture.

Defense attorney C. Zadik Shapiro asked the defendant if he ever attempted or intended to rape Ms. Doe.

Fighting back tears, the defendant said he that he did not "attempt or think of raping her."

He also admitted making "bad choices," and said he should have stopped the assault when the victim recognized his voice.

Velasquez, who had never been arrested before, remains in custody in lieu of $1 million bail.

If convicted of all charges, he could face up to life in prison.

If acquitted of attempted rape and kidnapping with intent to rape, he could serve less than 10 years.