A Scarborough man was sentenced Wednesday in federal court to nearly three years in prison for possession of a gun while subject to a protection order.

Primo Tosi, also known as Brian Tosi, 31, was sentenced by U.S. District Court Judge D. Brock Hornby to 33 months in prison and three years of supervised release for possession of a firearm by a person subject to a protection order.

Tosi pleaded guilty to the charge in October.

According to authorities, Scarborough police were called in May 2016 by Tosi’s former girlfriend, who said Tosi had threatened her with a gun. In searching Tosi’s house under a warrant, police said they found a 12-gauge shotgun, an antique rifle and ammunition.

The U.S. Attorney’s Office said Hornby’s sentence was harsher than the year-long sentence called for in federal guidelines because Tosi has been convicted four times for misdemeanor domestic violence against three different women and posed a high risk of reoffending.