A man who stabbed two northeastern Indiana police officers trying to take him into custody was sentenced Tuesday to 20 years in prison.

Brandon M. Gardner, 18, of New Haven learned his punishment after pleading guilty to aggravated battery creating a substantial risk of death and breaking and entering, WANE-TV reported.

On the morning of Dec. 13, 2021, Gardner was threatening suicide when two officers arrived at his New Haven home, and he fled from the residence and tried to break into neighboring homes, entering two of them, police said.

INDIANA MAN SENTENCED TO LIFE IN PRISON FOR DISMEMBERMENT KILLING

Indiana News

An Indiana man who tried to stab two police officers has been sentenced to 20 years in prison. (Fox News)

When officers caught up with him, he stabbed both with a pocket knife. They were released after treatment at a hospital.

CLICK HERE TO GET THE FOX NEWS APP

Charges including attempted murder were dismissed under a plea agreement.