More than six dozen Illinois sheriffs have vowed to defy a gun-control law signed by Democratic Gov. J.B. Pritzker that bans semiautomatic rifles.

"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."

Boewe is one of at least 74 sheriff offices that have posted statements in opposition of the law, according to ABC News.

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

SEMIAUTOMATIC WEAPONS BAN BECOMES ILLINOIS LAW

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)

The Illinois Sheriff's Association said in a statement that it 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.

"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."

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

Dozens of sheriff's offices have since issued similar statements.

JB Pritzker at podium

Illinois Gov. J.B. Pritzker (AP Photo/Charles Rex Arbogast/File)

Richland County Sheriff Andrew R. Hires said in a Facebook post that "The right to keep and bear arms for defense of life, liberty and property is regarded as an inalienable right by the people."

"I, among many others, believe that HB 5471 is a clear violation of the 2nd Amendment to the US Constitution," Hires said. 

There are at least 102 sheriff's offices in Illinois. The 74 offices vowing to defy the new law will affect roughly 30% of residents in the state, according to ABC News.

ILLINOIS SHERIFF WILL NOT ARREST PEOPLE SOLELY FOR POSSESSING SEMIAUTOMATIC WEAPONS AFTER STATE BAN

Illinois state Capitol

The Illinois State Capitol (Armando L. Sanchez/Chicago Tribune/Tribune News Service via Getty Images/File)

Cook County, the state’s most populous county that is home to about 40% of the Illinois population, has not spoken out against the law.

Pritzker said during an interview on MSNBC last week that sheriffs opposing the law are taking part in "political grandstanding."

CLICK HERE TO GET THE FOX NEWS APP

"It’s our state police and law enforcement across the state that will, in fact, enforce this law, and these outlier sheriffs will comply or, frankly, they’ll have to answer to the voters," Pritzker said.

His office added in comment to Fox News Digital on Monday that "sheriffs have a constitutional duty to uphold the laws of the state."

"This is political grandstanding at its worst.  The assault weapons ban is the law of Illinois. 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," a Pritzker spokesperson said. 

"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."

Fox News' Greg Wehner contributed to this report.