(AP) — Colorado’s Democratic-led Legislature capped its 2022 session Wednesday by passing a bill designed to confront the fentanyl crisis by giving prosecutors more room to pursue felony convictions while providing substantial support and treatment services.

With fentanyl overdose deaths skyrocketing nationwide, lawmakers struggled for weeks to fashion a bill lowering the fentanyl possession threshold for felony charges while bolstering treatment options for witting and unwitting users. Negotiations focused on whether prosecutors must prove that defendants knowingly possessed fentanyl, a deadly synthetic opioid that’s frequently mixed with other drugs without users’ knowledge, to pursue felony charges.

In the end, lawmakers adopted language allowing some defendants a way to present evidence at trial that they didn’t know they possessed a substance containing fentanyl in hopes of reducing felony charges to misdemeanors. Opponents said that language will frustrate prosecutors’ pursuit of felony convictions.

The bill strengthens criminal penalties for fentanyl dealers and creates a prevention campaign, among other initiatives aimed at attacking the crisis outside the criminal justice system. Gov. Jared Polis immediately applauded passage of the bill.

Polis and fellow Democrats had pledged at the start of the four-month session to tackle rising crime and soaring inflation — key issues highlighted by minority Republicans heading into this year’s midterm elections.

A number of crime-related measures and bills to lower fees on services for residents and businesses passed the Statehouse earlier in the session. Lawmakers also prioritized bills to spend nearly $2.6 billion in federal pandemic aid for Colorado at the risk of losing it.

The session was marked by landmark passage of a law enshrining the right to abortion in state statute, another expanding pre-school education and another expediting constitutionally mandated tax refunds to residents this year instead of next. But the fentanyl effort and other legislation had been delayed by minority Republicans frustrated with Democrats’ plans to speed through dozens of late-session bills, The Colorado Sun reports.

The impasse was resolved following a 20-hour session that ended Tuesday in which Democrats offered key concessions, including modifying the scope of a bill to grant collective bargaining rights to thousands of county public employees. The Colorado Municipal League strongly opposed the bill, citing its potential cost to localities.

Lawmakers passed a bill to enhance security for Colorado’s top elections official and other statewide office-holders in the wake of increasing threats against public servants. Democratic Secretary of State Jena Griswold, a debunker of fraudulent claims that the 2020 election was stolen from then-President Donald Trump, has received thousands of threats since that election.

Legislators also passed an elections security bill, backed by the state county clerks association, to tighten procedures and training for county employees with access to voting equipment. It was inspired by allegations that Mesa County’s Republican Clerk Tina Peters played a role in stealing election data from that county’s voting machines.

Peters, a candidate this year for secretary of state, denies the allegations. The bill was fiercely opposed by Republicans, who successfully deleted a provision, on free-speech grounds, that would have banned elections officials from spreading “disinformation” about elections.

Lawmakers passed a bill Tuesday to pay $600 million of Colorado’s $1 billion debt to the federal government after its unemployment trust fund was exhausted during the coronavirus pandemic. Republicans unsuccessfully sought to pay the entire amount, mindful of the increased cost to employers who pay into the fund and, as with other Democratic spending, warning that Colorado’s record $36.4 billion budget for the coming fiscal year is a one-time bonanza fed by federal pandemic aid.

Following December’s Boulder County wildfire that destroyed more than 1,000 homes and businesses, lawmakers passed several bills boosting the state’s firefighting resources and mitigation planning for fires that, owing to climate change and the West’s megadrought, have become a year-round threat in Colorado.

Senate Democrats on Wednesday abandoned a last-minute proposal, backed by Polis, to pursue tougher statewide building codes for urban areas abutting wildland to deal with that threat. Republicans, long defenders of local control by municipalities, objected to the surprise proposal being added to fire mitigation legislation.

(© Copyright 2022 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)