A suicidal man who attacked his rescuer was sentenced to prison Friday, nearly three years after stabbing a California Highway Patrol officer in the eye.

Javier Hernandez, 48, was trying to jump off the La Sierra Avenue overpass above the 91 Freeway in 2012 when CHP Officer Dane Norem grabbed his leg to stop him, Riverside County authorities said.

Hernandez pulled out a knife and attacked Norem for about three minutes. The assault nearly left Norem blind.

"I got slashed at first, I got a diagonal cut that came across my face which ultimately popped my eye," Norem said. "I got several stab wounds to my shoulder and a few lacerations to my arm."

Norem says he continued to hold onto Hernandez, despite being stabbed, because he feared if Hernadez jumped a motorist could have been hurt or killed below.

Three people came to aid Norem, including an off-duty Riverside Police Officer and a San Bernardino County sheriff's sergeant.

Norem was honored for his actions with California's Medal of Valor in 2013. Although he is still recovering, he hopes to resume patrolling within the next few months.

Hernandez apologized to Norem at his sentencing Friday, during which Riverside County Superior Court Judge Michelle Levine also commended the people who helped rescue Norem.

"It was nice that he apologized," Norem said. "And hopefully he meant it. And everyone will move on from here."

Hernandez was sentenced to 18 months to life in prison.