The new gun court, designed to resolve many illegal gun cases within six months, will deal with only gun possession cases — not those in which a person has been accused of opening fire in the street, officials said. Most of those charged with gun possession are young men, many of whom have never been arrested. In the current system, where young men arrested with guns are mixed with other criminal matters, many are given low bail or released on their own recognizance, a fact that has frustrated police officials who say officers are repeatedly arresting the same young men with guns.

It is not the first time the city has embarked on a dedicated court to try gun cases. A decade ago, also in Brooklyn, officials established a so-called gun court. At the time, judges were disallowing guns as evidence in many possession cases after determining that police officers did not have probable cause for their arrests or reasonable suspicion for the searches that turned up weapons. Different judges often gave sentences of less than a year.

The special court with a dedicated judge began hearing cases in 2003. But by 2009, the volume of cases had grown with the swelling of stop-and-frisk encounters, and a state law change increased the minimum sentence for possession of a loaded weapon, resulting in fewer plea deals. The special court ended in Brooklyn that year.

A 2005 study by the New York City Criminal Justice Agency found that in the Brooklyn program’s first year, it achieved the goal of speeding up cases and increasing the length of sentences. But the program also saw a decline in indictments and a rise in the number of cases dismissed in the early stages.

Dismissals increased partly because prosecutors in the program began taking a harder look at the evidence and determining themselves which cases would survive judicial scrutiny, officials said. Just over half of the gun possession cases brought citywide in 2014 resulted in a conviction, officials said. A third were dismissed, and in 10 percent of cases, district attorneys declined to prosecute. “The big challenge on these gun cases is that the officer has to be able to articulate at a hearing how they were able to find this weapon,” one law enforcement official said, speaking on the condition of anonymity to discuss the plan before the announcement. “Often the weapons are concealed in someone’s jacket, coat, waistband, and they have to articulate what their basis was for the approach. A lot of these cases fall on the search.”

The new court program will not affect the existing gun diversion programs in Brooklyn, which apply to a small number of gang-affiliated young men who are arrested with weapons but do not have a criminal record.

When gun cases result in prison sentences, the police intend to broadcast each instance through social media as a form of deterrence.

“We will get away from this notion that some gun cases are mere possession cases,” said Richard M. Aborn, president of the Citizens Crime Commission of New York City, who helped to spearhead the new approach. “When somebody makes a decision to pick up a gun, that’s like a pre-murder case.”