With the future of federal gun control legislation uncertain, an affluent Chicago suburb this week took the aggressive step of banning assault weapons within its borders, in what local officials said was a direct response to the mass shooting at a Parkland, Fla., high school earlier this year.

Officials in Deerfield, Ill., unanimously approved the ordinance, which prohibits the possession, manufacture or sale of a range of firearms, as well as large-capacity magazines. Residents of the 19,000-person village have until June 13 to remove the guns from village limits or face up to $1,000 per day in fines.

The measure drew a swift criticism from the National Rifle Association and the gun rights group Guns Save Life, which said they would sue Deerfield to overturn the ban.

“Every law-abiding villager of Deerfield has the right to protect themselves, their homes, and their loved ones with the firearm that best suits their needs,” Chris W. Cox, executive director of the NRA’s lobbying arm, said in a statement.

Deerfield Mayor Harriet Rosenthal said officials took up the ordinance because of the February massacre at Marjory Stoneman Douglas High School, where a gunman armed with a military-style rifle killed 17 students and staff members before police arrested him.

“We hope that our local decision helps spur state and national leaders to take steps to make our communities safer,” Rosenthal said in a statement.

Congress and state and local legislatures around the country have faced mounting calls to enact similar measures in the wake of the Parkland shooting and the nationwide student-led demonstrations in support of gun control that followed.

Polls conducted in recent weeks have showed growing public support for assault weapons bans. A Feb. 20 Quinnipiac poll found that 67 percent of Americans, including 43 percent of Republicans, favored such a ban.

Most proposals have struggled to gain traction. In early March, Florida lawmakers voted down a bill to ban assault weapons, then held a moment of silence for victims of the Parkland shooting. Two assault weapons ban bills in Congress have garnered broad Democratic support but lack Republican cosponsors.

Several powerful federal appeals courts have ruled that prohibitions on assault weapons were permissible under the Second Amendment, and no federal appeals court has ever held that assault weapons were protected.

The U.S. Supreme Court has ruled that the Second Amendment protects an individual right to possess a firearm, but the high court has not directly addressed assault weapons in the same context.