NEWARK, NJ — The "sensitivity and restraint" of Newark police and SWAT members helped to avert a tragedy in the city's North Ward on Wednesday night when officers talked an armed man into giving up a replica gun, authorities said.

The incident began around 11 p.m. when local police responded to a building on the 100-block of Park Avenue after getting a call about a man "in distress" who was throwing small objects off the roof, according to the Newark Department of Public Safety. When 2nd Precinct officers arrived on the scene, they found the 27-year-old man in the building's stairwell and tried to "calm him down," authorities said. And that was when they noticed that he had a gun.

Police didn't further identify the "distressed man" in their statement about the incident. After noticing that the man was apparently armed, the officers got his family members to safety and contacted the Newark Police Department SWAT.

When SWAT members arrived on the scene, the man allegedly began to pull the trigger on the gun, but it didn't fire. SWAT members continued to "carefully negotiate" with the man, and he eventually agreed to release the weapon, authorities said. Police later determined that the gun was a replica, authorities said.

Emergency responders transported the man to a nearby hospital for an evaluation. No charges have been filed against him, a Newark police spokesperson said Thursday.

"I am grateful that a tragedy was averted due to the quick thinking of the members of the Newark Police Division who responded to this dangerous and unpredictable situation," Mayor Ras Baraka said. "The preservation of life is always first and foremost in public safety. And I commend the officers and SWAT members at the scene for protecting our residents while negotiating a safe resolution in this incident."

Newark Public Safety Director Anthony Ambrose said that it takes "great sensitivity and restraint" to recover a weapon – even a replica gun - from a distressed person who is posing a potential threat to officers or bystanders. "I praise the officers and members of the Emergency Response Team for adjudicating this matter without using force," Ambrose said. "Although the gun was a replica, it could have resulted in deadly force and I'm proud that the officers' restraint training was appropriately applied."