Gun rights groups sued Tuesday to block Pittsburgh from enforcing firearms legislation passed after a mass shooting at a synagogue, accusing city officials of blatantly defying the state's prohibition on municipal gun regulation.

The Pittsburgh City Council on Tuesday approved gun legislation, including a restriction on assault weapons like the rifle used in a massacre at a city synagogue last year, and Mayor Bill Peduto, a Democrat, signed the measures into law, declaring the community had come together "to say enough is enough.”

Minutes later, a coalition of gun-rights groups sued to get the newly minted laws overturned, calling them "patently unenforceable, unconstitutional, illegal.

Shortly after that, a second lawsuit, this one backed by the National Rifle Association, declared that "Pittsburgh has violated the rights of its citizens."

"Worse yet, Pittsburgh has committed this violation without any realistic prospect of diminishing the ... incidence of horrific mass shootings," said the suit, filed by four city residents. "All it will do is leave law-abiding citizens more vulnerable to attack from better-armed and more ruthless assailants."

The bills were introduced in December 2018, two months after a gunman armed with an AR-15-style assault rifle and a handgun killed 11 people and wounded seven at the Tree of Life Synagogue.

A menorah at a memorial outside the Tree of Life Synagogue on the first night of Hanukkah in Pittsburgh on Dec. 2, 2018. Gene J. Puskar / AP

The new laws make it illegal to "use" an assault weapon in a public place, bans most uses of armor-piercing ammunition and high-capacity magazines and allow authorities to temporarily seize firearms from people who are considered to be a danger to themselves or others. The first two laws are due to take effect in 60 days, the imminent-danger law in 180 days.

Breaking: Pgh Mayor signs gun control legislation #wpxi pic.twitter.com/hczIP1jrlZ — Rick Earle (@WPXIRickEarle) April 9, 2019

Pennsylvania state law prohibits municipalities from regulating guns, and pro-gun advocates had threatened to sue to keep the laws from going into effect.

The city will be represented in court by lawyers with Everytown for Gun Safety, a group backed by billionaire Michael Bloomberg, the Associated Press reported.

In another legal filing Tuesday, the Allegheny County Sportsmen's League asked a judge to hold the city, Peduto and six council members who voted for the gun-control legislation in contempt of court, contending they violated a 1995 legal settlement in which city officials dropped an earlier effort to ban assault weapons and agreed to "abide by and adhere to Pennsylvania law."

"It is unfortunate that ... taxpayers will be burdened by the city's elected officials believing it is acceptable — and even gloating — that they are violating the Pennsylvania Constitution and Crimes Code," Joshua Prince, a lawyer seeking to overturn the laws, wrote in a statement.