A Buffalo man who pleaded guilty to weapons and contempt charges for using knives to threaten a former girlfriend and another person at her home was sentenced last week to 2½ to five years in prison.

State Supreme Court Justice Deborah A. Haendiges imposed the prison term Friday on Michael Jackson, 45, of Bailey Avenue, who admitted violating a domestic violence order of protection on Dec. 5, 2012, and again on Jan. 6, 2013, when he unlawfully entered the woman’s residence with knives and made threats.

A quick response by Buffalo police officers on patrol prevented any injury to the woman and the other person, prosecutors said.

Jackson pleaded guilty in December to two counts of third-degree criminal possession of a weapon, one count of second-degree criminal contempt and one count of aggravated criminal contempt.

Jackson was sentenced as a second felony offender. He has a previous conviction for first-degree criminal contempt in a domestic violence case.