A New Hampshire man was arrested after a standoff with York County deputies at a Shapleigh home early Sunday morning.

York County Sheriff William King said deputies were called to a home on Owls Nest Road at 12:15 a.m. Sunday where Andrew Mayer, 47, of Intervale, New Hampshire, showed up uninvited by his estranged girlfriend. Mayer was out on bail for a domestic violence charge involving the girlfriend and was not to have any contact with her.

King said the two argued. Mayer grabbed an AK-47 rifle in the home and put the barrel of the gun in his mouth, threatening to kill himself. King said the girlfriend fled.

Deputies cordoned off the area and communicated by telephone with Mayer, who continued to threaten suicide. Mayer exited the home, and deputies apprehended him with a Taser after Mayer failed to submit to them, King said.

Mayer is being held at York County Jail in Alfred. He is scheduled for arraignment Monday.