Police say 25-year-old Benjamin McGary of Bangor went to a home on C Street about 1 p.m. on Wednesday afternoon.
Authorities said McGary was not legally allowed to be at the property.
Police locked down the area and a tactical team was called in.
McGary eventually came out peacefully and surrendered.
In addition to McGary's having violated a protection order, police said they also arrested him on an active warrant for several domestic violence-related charges.
Authorities said they recovered a rifle believed to be related to the incident from the C Street residence after his arrest.
McGary is being held at Penobscot County Jail.