State legislative leaders agreed Wednesday to a top priority of advocates for sex assault survivors: the formation of a task force to examine how authorities investigate and prosecute such crimes in Minnesota.

The deal, struck in an overnight bargaining session following Monday’s end-of-session deadline, was added to a public safety spending bill headed for a special session of the Legislature later this week. It follows a Star Tribune investigative series into widespread failings among law enforcement in the handling of rape investigations.

The statutory reform task force appeared in jeopardy earlier this week heading into the final hours of talks to craft a deal on a broader public safety finance package.

But Gov. Tim Walz and DFL and Republican leaders signed off on an overnight compromise between two competing budget proposals arising from the House and Senate. The bill in the DFL-led House included the task force. The version in the GOP-led Senate did not.

That divide threatened to hold up the proposed task force along with related measures requiring law enforcement to create written policies on responding to reports of sexual assaults.

Under the pending public safety package, victims would be able to report sexual assaults to any law enforcement agency regardless of jurisdiction. But another proposal to eliminate the statute of limitations for certain sex assault crimes was not approved.

The task force was deemed a top priority by groups like the Minnesota Coalition Against Sexual Assault, which emphasized the need to bring together law enforcement, prosecutors and advocates for sex assault survivors to craft a comprehensive set of recommendations for changing the law to make it easier to prosecute sexual assault.

The coalition sounded the alarm earlier this week over reports that the measure could become a casualty of late-session budget negotiations, which were still being finalized Wednesday in behind-the-scenes talks led by Walz, House Speaker Melissa Hortman, DFL-Brooklyn Park, and Senate Majority Leader Paul Gazelka, R-Nisswa.

State Rep. Carlos Mariani, D-St. Paul, who co-chaired a conference committee on the public safety bill, said that the task force was atop his key sticking points during negotiations.

“It really could be a game changer,” he said. “We have an opportunity to actually reform everything and the public’s ready for it.”

Mariani’s counterpart, Sen. Warren Limmer, R-Maple Grove, has said he generally harbored skepticism over the usefulness of task forces. But in announcing the measure, he described it as a needed tool to better obtain justice.

“The task force will utilize the experiences of a diverse group of stakeholders to bring forward reforms so that victims may better pursue justice for crimes committed against them,” Limmer said. “We are taking this issue very seriously, recognizing breakdowns in the system and hoping this will lead to more positive outcomes in the future.

The rape task force deal came together as several other contentious public safety issues fell by the wayside.

A proposal to cap probation sentences at five years and change how traffic fines and driver’s license suspensions are imposed did not advance despite a sustained push by both progressive and conservative groups throughout the session.

Two major gun control bills — one expanding criminal background checks to cover private sales and another that would create a “red flag” law — were struck down earlier in conference committee.

The task force agreement also will lead to the creation of a statewide Missing and Murdered Indigenous Women Task Force that will collect data on a wave of missing and murdered Indian women in Minnesota.

Under the broader public safety spending bill, the Department of Corrections is expected to receive $10.3 million to recruit 67 new officers in response to calls to improve prison safety and security after two officers died on the job last year. The governor’s budget initially called for enough money to hire 120 officers. It also revives an ombudsman’s office to investigate prisoner complaints, but it does not establish a parole board sought by Corrections Commissioner Paul Schnell that would broaden decisionmaking in granting early release to those serving life sentences.

Minnesota is one of just four states where a single official makes those decisions, and Schnell called for a “shared governance approach” that would convene a “panel of experts” to review early release decisions.

The rape task force was spurred by the Star Tribune’s 2018 “Denied Justice” series, which analyzed more than 1,500 reports of sexual assault to shed light on the errors plaguing most rape investigations.

Three years after another Star Tribune series on Minnesota’s excessive use of solitary confinement, the budget deal includes a provision limiting the practice.