A Pennsylvania judge on Tuesday struck down three gun control ordinances enacted by the City of Pittsburgh after the mass shooting at the Tree of Life synagogue last year, saying that state law prevented the city from regulating firearms.

The ordinances, announced in December, include an assault weapons ban, a ban on large-capacity magazines and a measure that empowered courts to stop people from possessing firearms if they posed an imminent threat to themselves or others.

But Judge Joseph M. James of Allegheny County said in his opinion in the Court of Common Pleas that state law “pre-empts any local regulation pertaining to the regulation of firearms,” despite the “large amount of energy” the city put into arguing that its ordinances were lawful.

[The city marked the first anniversary of the shooting this week.]

Judge James’s decision came just two days after the first anniversary of the massacre. On Oct. 27, 2018, a gunman opened fire at the synagogue and killed 11 people after the authorities said he had spewed anger toward Jews and immigrants online.