The Bangor man accused of threatening a group of people Tuesday outside a Second Street apartment building told police he got the gun to protect his family after a tenant threatened to slit his dogs’ throats and attack his girlfriend and children, according to court documents.

Kyle Riegel, 31, is charged with two counts of felony terrorizing with a dangerous weapon and misdemeanor assault.

He was arrested Tuesday and taken to the Penobscot County Jail. Riegel was released Wednesday on a Maine Pretrial Services contract after posting $100 cash bail. Conditions include not being on Center Street in Bangor, not possessing dangerous weapons and having no contact with the three alleged victims, according to court documents filed at the Penobscot Judicial Center.

Maine Pretrial Services is a private firm that monitors defendants on bail prior to the resolution of their cases.

Riegel lives on Center Street in Bangor but his girlfriend lives on Second Street and has had ongoing disputes with a female neighbor, who is not being named because she is an alleged victim in the case.

A police officer happened upon a crowd of people about 12:40 p.m. Tuesday on Second Street near the Cedar Street intersection. People told him there was “a male in a cowboy hat threatening to shoot everyone,” according to police.

The dispute allegedly began when Riegel’s girlfriend became upset because someone was parked in her assigned space at the apartment house.

Information about who was parked in her spot was not included in court documents.

Things escalated as other neighbors became involved and more police were called to the scene, the affidavits said. In all, seven officers responded.

Riegel allegedly pointed a loaded .22-caliber LR Ruger Wrangler at two people and allegedly punched a female witness in the nose after holding the gun to her head.

Officers recovered the gun, which was not fired during the altercation.

Riegel is next due in court on April 5. If convicted, he faces up to five years in prison and fine of up to $5,000 on the terrorizing charges and up to a year in prison and a fine of up to $2,000 on the assault charge.