Green pleaded guilty to attempted second-degree murder, which carries a 25-year sentence, and first-degree robbery for stealing the trooper's radio, for which he will receive a consecutive five-year-term.

Green, a former Albany High School student, faced up to 40 years to life in prison if convicted at trial. He accepted the plea deal while holding a Bible in his hands before Albany County Judge Stephen Herrick, who will sentence him on Aug. 15.

On the day of the attack, Green approached Smith, saying he was homeless and needed a place to stay. When Smith asked Green for his name to check for outstanding warrants, Green attacked with a steak knife, narrowly missing his windpipe, police said.

State Police captured Green on March 6 as he was walking near the intersection of Western and Washington avenues in Albany.