BUFFALO, N.Y. (AP) — A former western New York sheriff's deputy has been sentenced to five years in prison for a two-day attack on his girlfriend that left her unconscious and in the hospital.

Erie County prosecutors say police arriving at 40-year-old Dennis McAndrew's Buffalo home in December found the mother of his youngest child unresponsive. She spent more than a week in a Buffalo hospital with injuries to her face and body.

McAndrew pleaded guilty to assault in August. Since then, prosecutors say he violated an order of protection by sending the victim letters from jail.

At Tuesday's sentencing, a judge signed an order prohibiting him from having any contact with the woman until 2031.