Democratic Illinois Gov. J.B. Pritzker’s office slammed the more than six dozen sheriff’s offices that have publicly vowed to defy a gun-control law that bans semiautomatic rifles and other weapons.

"This is political grandstanding at its worst. The assault weapons ban is the law of Illinois," Pritzker’s office told Fox News Digital on Monday. "The General Assembly passed the bill and the Governor signed it into law to protect children in schools, worshippers at church, and families at parades from the fear of sudden mass murder."

The Illinois Senate passed its version of the "Protect Illinois Communities Act" last Monday, which bans so-called assault weapons and high-capacity magazines from being manufactured or sold in the state. Pritzker signed the bill into law last Tuesday, prohibiting the manufacture and sale of semiautomatic rifles and pistols, .50-caliber guns, as well as attachments that can increase a gun’s fire rate.

At least 74 sheriff offices have since publicly posted statements in opposition of the law, with many calling it unconstitutional.

DOZENS OF ILLINOIS SHERIFFS VOW TO DEFY GOVERNOR'S ASSAULT WEAPONS BAN

Illinois Gov. Pritzker

Illinois Governor J.B. Pritzker defended a gun-control law after pushback from numerous sheriffs in the state. (Scott Olson/Getty Images)

"Part of my duties that I accepted upon being sworn into office was to protect the rights provided to all of us, in the Constitution," Edwards County Sheriff Darby Boewe said in a Facebook post.

"One of those rights enumerated is the right of the people to KEEP and BEAR ARMS provided under the 2nd Amendment. The right to keep and bear arms for defense of life, liberty and property is regarded as an inalienable right by the people."

SEMIAUTOMATIC WEAPONS BAN BECOMES ILLINOIS LAW

The Illinois Sheriff's Association said in a statement this month that it has opposed the bill since its inception.

"We, as a representative of chief law enforcement officials throughout Illinois, are very concerned and disturbed by the ongoing and escalating violence throughout our State and Country," the statement, released Wednesday, said.

Guns in Illinois

AR-15-style rifles are on display at Freddie Bear Sports gun shop in Tinley Park, Illinois, on Aug. 8, 2019. (Zbigniew Bzdak/Chicago Tribune/Tribune News Service via Getty Images) (Zbigniew Bzdak/Chicago Tribune/Tribune News Service via Getty Images)

"We are always supportive of new tools, techniques and laws that assist us in preventing and holding accountable those that wage efforts of harm and violence on others. However, this new law does not do that."

When approached about the dozens of sheriff’s offices vowing the flout the law, Prizker’s office told Fox News Digital that law enforcement offices don’t have the authority to "pick and choose which laws they support."

SECOND AMENDMENT GROUPS WARN OF ILLINOIS GUN CONTROL BILL HEADING TO GOVERNOR'S DESK

Illinois state Capitol

The Illinois State Capitol on Jan. 6, 2022, in Springfield, Illinois. (Armando L. Sanchez/Chicago Tribune/Tribune News Service via Getty Images)  (Armando L. Sanchez/Chicago Tribune/Tribune News Service via Getty Images)

"Sheriffs have a constitutional duty to uphold the laws of the state, not pick and choose which laws they support and when. We’re confident that this law will hold up to any future legal challenges, but again, it is the current law of our state. Anyone who advocates for law, order, and public safety and then refuses to follow the law is in violation of their oath of office," the governor’s office said. 

CLICK HERE TO GET THE FOX NEWS APP

Gun dealers and Second Amendment advocates have said they are readying lawsuits to challenge the ban.