The ruling by Judge Frederick J. Scullin Jr., made public Saturday, orders the city to end its prohibition against carrying a pistol in public.
It was not clear Saturday night what immediate effect the order would have.
The order was addressed to the District of Columbia and Police Chief Cathy Lanier, as well as their employees and officers and others "who receive actual notice" of the ruling. But it could not be determined Saturday night who had received notice. Also unclear was whether the city would appeal and what effect that would have on the enforcement ban.
Legal sources said Saturday night that in general all parties to a case must be duly informed of a ruling and given the opportunity to appeal before it takes effect.