A Kittery man with a “significant history of domestic abuse” was sentenced Friday to more than three years in federal prison for buying a semi-automatic rifle and over 180 rounds of ammunition, the U.S. Attorney’s Office said.

Zachary Spinney, 36, was sentenced in U.S. District Court in Portland after pleading guilty Nov. 28 to a charge of possessing a firearm while subject to a protection from abuse order. The order was issued in March 2016 in Maine.

According to court records, Spinney and his girlfriend bought the rifle and ammunition in July 2016 from a licensed dealer, and later that day Spinney fired the rifle at a sand pit in Eliot.