GALVESTON, TX (AP) - The Galveston City Council voted to scrap an ordinance that prevented gun shops and shooting ranges from being located near schools or places of worship.

The City Council approved the amended land-use regulations in a unanimous vote Thursday to comply with state law and avoid a potential lawsuit.

The Texas Attorney General’s Office sent a letter to the city warning it couldn’t make laws regulating ownership, transfer, transportation or storage of firearms.

“The Office of the Attorney General demands that the City repeal these regulations and any like them immediately,” Assistant Attorney General Cleve Doty wrote in the letter. “Rather than file litigation now, we are confident that the City of Galveston intends to comply with Texas law and will rescind regulations that are in violation of Texas law.”

Prior to the vote, council members acknowledged that their hands were tied by state law.

Gun shops will now be treated the same as any other commercial retail entity. Shooting ranges will also no longer be required to limit noise to a certain decibel level.