SOMERSWORTH — Two men were hospitalized with gunshot wounds that police said were from an accidental discharge of a handgun, but the investigation is ongoing.

Somersworth police report that at approximately 1:27 a.m. on July 5, two males entered the Wentworth-Douglass Hospital emergency room with gunshot wounds. One man had a wound to his right hand while the second was wounded in his right thigh.

Police Chief David Kretschmar said the hospital reported the incident to police.

Police said it was initially reported to the department that the wounds were received when another male entered their home on Pleasant Street and shot them. However, an investigation by the department’s Patrol and Investigation Division revealed the wounds were the result of an accidental discharge of a .45 caliber Glock handgun inside the residence. Police said the gun was recovered by investigators.

As of mid-morning, one person remained hospitalized, Kretschmar said.

A man at the Pleasant Street house where the incident is believed to have occurred had his right hand bandaged up said he was the person who fired the gun and that it hit him and the other person. The man, who didn't identify himself, said he had the gun pointed downward. He said he didn't realize there was still a bullet in the gun. "I didn't know it," he said. "It was an accident."

A neighbor who lives nearby who declined to identify himself said he didn't hear any gunshots, but awoke around 2 a.m. to a police presence in the neighborhood. "The whole street was lit up with police headlights," he said. The man said police remained on scene until about 7 a.m. He also reported seeing a K9 unit around 6 a.m. Kretschmar said the K9 officer was on duty at the time.