NEW BEDFORD, Mass. (WPRI) — New Bedford police arrested a man on gun charges while conducting an unrelated investigation, the department said in a social media post.

Police said that while officers were looking into a stabbing that had taken place in the city’s north end, they detained a man trying to leave the scene.

The man, 22-year-old Victor Abraham Rodriguez Ortiz of New Bedford, was found to be carrying a loaded handgun without a license, according to police.

He was taken into custody and charged with carrying a loaded firearm without a license and possessing ammunition without a firearm identification card, according to arrest logs.

The stabbing victim was taken to the hospital for emergency treatment, though his injuries were not life-threatening.

Police said they are continuing to investigate the stabbing and ask anyone with information to call 508-99-CRIME or leave an anonymous tip on the department’s website.