A Buffalo man convicted of breaking into his girlfriend’s apartment, attacking her and later threatening to kill her and a male friend was sentenced Monday to seven years in prison.

State Supreme Court Justice Deborah A. Haendiges imposed the prison term on Jerome Ingram, 34, after a jury convicted him in March of second-degree burglary but acquitted him of a weapon charge.

As a second felony offender, he had faced a maximum 15-year prison sentence.

Prosecutors said Ingram got into an argument with his girlfriend on June 28, 2012, at her apartment on Zelmer Street, off Genesee Street, near Schiller Park. She asked him to leave, and he pretended to go, but hid in a room. She called a friend and invited him over. When the friend arrived, Ingram attacked her, then fled when police were called, prosecutors said.

He then re-entered the apartment through a window as police searched for him outside. Prosecutors said he pulled out a knife and threatened to kill his girlfriend and the other man. As police closed in, Ingram fled with the two victims’ cellphones. When his girlfriend went outside to summon police, Ingram attacked her again, repeatedly kicking her. After a foot chase with police, he was found hiding under bushes, with the knife and cellphones.