A District man will spend more than four years in prison for stabbing a homeless man in his sleep last fall, authorities said Monday.

Percy W. Carter, 53, approached a 48-year-old homeless man lying in his sleeping bag in the 1300 block of 18th Street NW and stabbed him at least five times, according to the U.S. Attorney’s Office

Carter pleaded guilty to one count of assault with a dangerous weapon in January, according to authorities.

Authorities said Carter and the victim knew each other before the stabbing: Carter had accused the victim of being involved with his girlfriend.

While yelling his girlfriend’s name and that he was killing the victim, authorities said, Carter cut through the man’s bedding and sliced him twice in the ribs before he could get away.

Read more: The Post’s crime coverage