A gun-rights organization has told several municipalities in Montgomery County and around the state to change various local firearms laws — or face a possible lawsuit backed by the Washington state-based group.

The Second Amendment Foundation, a nonprofit founded nearly 40 years ago, has sent letters to officials in Gaithersburg, Poolesville, Garrett Park, Cheverly, Walkersville and others, highlighting portions of each community’s code that the foundation says violate state law. The organization “respectfully requests and formally demands” that each town change its laws.

Poolesville’s code, for example, gives the town government the authority to regulate firearms during civil emergencies and allows the president of the town’s commissioners to prohibit the sale or transfer of firearms. Those provisions violate state preemption law detailed in the Maryland criminal code, which prevents local jurisdictions from enacting tougher gun laws than the state, according to the foundation.

Poolesville Town Attorney Jack A. Gullo brought the letter before the Town Commission on April 15, and commissioners are planning to amend those sections of the code, which were adopted in 1975.

“We know the town needs to change the language,” said Jim Brown, president of the Town Commission. “We’re getting a recommendation from the town attorney on the rewording.”

The letters are part of a pilot program initiated by the foundation more than a year ago, said Dave Workman, the group’s communications director. The foundation began by examining local laws in Virginia and Washington state and sent out similar letters to dozens of communities in those regions, he said.

Most communities have been very cooperative and some even thankful to have conflicting provisions pointed out, Workman said. Most have amended their codes, and the foundation has not yet had to pursue legal action, he said.

If a lawsuit becomes necessary, the foundation plans to identify and work with local plaintiffs in the community, he said.

Gaithersburg forbids carrying firearms on city property, and Cheverly prohibits carrying firearms altogether — both of which exceed their authority under state law, according to letter sent by the foundation in March.

Gaithersburg’s letter has been distributed to the mayor and city council, but a discussion of the issue has not been scheduled, City Attorney Lynn Board said.

Cheverly, in Prince George’s County, has an election scheduled for May 6, so the Town Council will not address the matter until its May 23 worksession, said Town Administrator David Warrington.

Garrett Park officials have opted to ignore the letter received because the foundation has no standing, Town Administrator Ted Pratt said.

“We didn’t deem it worthy of response,” he said.

The foundation also has sent letters to Rockville, Takoma Park, Greenbelt, Morningside, Frederick, Cumberland, Hagerstown, Ocean City, Baltimore city and Annapolis, among others, Workman said.

Officials in Rockville and Takoma Park both said they had not yet seen such a letter.

The Town of Walkersville, in Frederick County, also received a letter, objecting to the town’s ban on carrying loaded firearms within town limits. Officials were resistant to the idea.

“I have no problem with gun rights, but for somebody to come here and say we need to make a change, I don’t know what dark basement they are living in,” Commissioner Russell Winch said.

Burgess Ralph Whitmore said he agreed. “I’m with Russell. Let them sue us,” he said.