The Arizona House approved new election restrictions late Thursday — including language intended to curb the power of Democratic Secretary of State Katie Hobbs — in budget legislation that will soon head to the governor’s desk.

The Republican measure seeks to stop Hobbs from playing a role in litigation related to state election rules and allows third parties designated by the legislature to flag ineligible voters for removal from the rolls. The bill also imposes new ballot printing requirements and provides funds for election security and post-election recounts.

The restrictions drew swift criticism from Democrats and voting rights advocates, who accused Republicans of crafting policies based on conspiracy theories and former president Donald Trump’s false claims that he lost the 2020 election because of massive fraud. Arizona is among the 18 states that have enacted new voting restrictions in the wake of last year’s election, along with Florida, Georgia and Iowa.

Democrat Joe Biden narrowly won the state in his successful White House bid, reversing more than 20 years of GOP nominees prevailing in Arizona.

“It is genuinely difficult to distinguish between bills that are driven by some calculated formula to suppress certain votes and bills that are driven by some random conspiracy theory on the Internet, because there are so many of both at this point — it’s unbelievable,” said Joel Edman, legislative and policy director for Arizona Advocacy Network.

Arizona Gov. Doug Ducey (R) is expected to sign the legislation, which passed 31-29 along party lines as part of a budget deal that included a $1.9 billion income tax cut.

Republicans have argued that the new election rules will prevent voter fraud and save money on litigation. The language curbing Hobbs’s power is “necessary to ensure the faithful defense of the State’s election integrity laws and to eliminate confusion created by the Secretary of State about who speaks for Arizona in court,” Katie Conner, spokeswoman for Attorney General Mark Brnovich, has stated, according to the Arizona Mirror.

Hobbs — who has defended the integrity of Arizona elections and is running for governor — accused Republicans of weaponizing the budget process “to exact partisan retribution against the Office of the Secretary of State.”

“This statutory sleight of hand is set to expire at the end of my term, leaving no doubt that this was prompted by my efforts to protect the freedom to vote and because they did not like the outcome of the Presidential Election,” she said in a statement.

The measure passed during a contentious, marathon session that began Thursday morning. Majority Leader Rusty Bowers (R) began by announcing a rules change to limit debate, tying the move to a Democratic walkout that stopped work two days prior.

“We met earlier this week to again perform the duties of the citizens of the state of Arizona. It is clear [and] was clear then by the absence of an entire caucus and by actions prior … that procedural obstruction and delay have been instituted in lieu of civility,” Bowers said.

The announcement prompted an outcry from Democrats.

“You are shutting us up with this rule change,” State Rep. Mitzi Epstein (D) said on the floor. “If you want to pass a rotten budget, you can pass a rotten budget because you have the power to pass it. But by golly, we’re going to be heard one way or another.”

The walkout echoed a similar action by Texas Democratic legislators in late May that temporarily blocked passage of sweeping new voting restrictions. Gov. Greg Abbott (R) responded by calling for a special legislative session that will begin July 8.

In Arizona, Democrats said blocking a quorum was necessary to give themselves time to read the budget bills before voting. Some voting restrictions were inserted at the last minute, advocates said.

The version passed Thursday night stated that “among state officials, the attorney general has sole authority to direct the defense of the state election law or laws being challenged” through Jan. 2, 2023, coinciding with the end of Hobbs’s term.

Other language gave the attorney general’s controversial Election Integrity Unit permission to review the state’s voter rolls, along with any person or entity designated by the legislature.

If the review “determines that there are persons registered to vote who are not eligible to register to vote, the secretary of state shall notify the appropriate county recorder and the county recorder shall remove those persons from the voter registration rolls,” the bill stated.

The legislation builds on existing voting restrictions in Arizona. In May, the state enacted changes to the state’s popular Permanent Early Voting List, which determines who receives mail ballots each election cycle — under the new rules, voters who do not cast a ballot at least once every two years will have to respond to a government notice to avoid being removed from the list.

The rules approved Thursday night “are just a mockery of democracy, and it’s all based on this lie,” State Rep. Lorenzo Sierra (D) said in remarks on the House floor.

“It’s all based on the former president saying, ‘Well, I’m going to be back in August,’ and everyone anticipating it like a second coming. I am no prophet, but I can tell you one thing: The orange rapture is not happening,” Sierra said.

Amy Gardner contributed to this report.