A federal judge has declared that one of the District’s principal gun control laws is unconstitutional and ordered that its enforcement be halted.

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 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 Sunday 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.

Alan Gura, the lawyer who represents the group challenging the ban, said Sunday that he believes the ruling to be in effect immediately. “The decision is in effect, unless and until the court stays its decision,” he said. “This is now a decision that the city is required to follow — the idea that the city can prohibit absolutely the exercise of a constitutional right for all people at all times, that was struck down. That’s just not going to fly.”

Citing studies of the number of registered gun owners who commit crimes, Gura said that he believes allowing citizens to carry handguns on the street for the purpose of self-defense will lead to a decrease in crimes.

“I believe the city is absolutely safer. Make no mistake about it. This is a fantastic improvement in public safety,” Gura said. “Yes, we have a problem in America with gun violence. But no, that problem is not the result of law-abiding people carrying guns.”

Ted Gest, a spokesman for the Office of the Attorney General for the District of Columbia, which defended the city’s ban, said the city is studying the opinion and its options, which include appealing the judge’s ruling and asking the judge to stop his ruling from going into effect during any appeal.

A spokeswoman for the police department said Saturday night that she was not aware of the ruling. On Sunday, Delroy Burton, the head of the D.C. police union, said that police officers had not received official instructions about whether to enforce the handgun law in light of the ruling.

The case was heard by Scullin, a senior U.S. District judge who normally sits in New York. In his ruling, Scullin said that, based on recent decisions, “there is no longer any basis” to conclude that the city’s “total ban on the public carrying of ready-to-use handguns outside the home is constitutional.”

Scullin said he was stopping enforcement of the law “unless and until” the city adopted a constitutionally valid licensing mechanism.

The suit against the city was filed by four named plaintiffs and the Second Amendment Foundation, which is based in Washington state.