BANGOR — A man wielding a weapon allegedly burst into a Curve Street apartment Wednesday evening and assaulted a man, then fired his weapon, where about a dozen people had gathered for a party, police say.

After firing the gun, Robert Smith, 44, who lives on Fourth Street, allegedly fled the scene and several people at the gathering made frantic 911 calls just before 9 p.m. to report the incident.

After knocking on the door and getting inside the 69 Curve St. apartment, “Smith presented a firearm, assaulted the male and a shot was fired inside the apartment,” Bangor Detective Sgt. Paul Kenison said in a Thursday press release.

A bullet hole was found in the wall of the apartment’s bathroom just above the toilet, and one witness said the fight was over a woman “who both men were dating,” court documents state.

Smith, who was found at his apartment building about an hour after the incident, was charged with criminal threatening with a dangerous weapon, a felony, and assault, and was taken to Penobscot County Jail.

The 48-year-old male victim Smith confronted was not hit by the bullet, but he was treated at St. Joseph Hospital for injuries from allegedly being struck in the head by the gun wielded by Smith.

Police found the victim with blood streaming down the left side of his head. He said he knew his assailant and said be believed the weapon was a 9 mm handgun, court documents state.

At least 10 police cruisers from agencies including the Maine State Police and Penobscot County Sheriff’s Department converged on the area Wednesday night, blocking the roadway. Officers searched for the suspect.

When police arrived at Smith’s apartment, they found it dark but heard loud voices coming from an up-stairs apartment. Sgt. Cathy Rumsey was able to contact Smith, who agreed to meet police out in front of the building. He was arrested without incident, Kenison said.

When asked if he had any guns in his apartment, Smith answered “several” and requested that police get a warrant before searching it, the court documents state.

Smith made his first appearance in 3rd District Court in Bangor on Thursday afternoon, where his bail was set at $1,000 cash or $10,000 surety. He remained in jail Thursday evening, a jail official said.

If released, Smith is barred from possessing any dangerous weapons and cannot have contact with the vic-tim. His court date is Sept. 26.

If convicted of criminal threatening, Smith could face jail time of up to five years and a fine of up to $5,000.

Because the case is still under investigation Kenison did not release the type of gun, and added that it was “not yet clear what the motive behind the confrontation was.”