House and Senate lawmakers released a sweeping, compromise criminal justice bill on Friday, marking the end to months of negotiations over a piece of legislation that eliminates some mandatory sentences for drug offenses, reforms the way juveniles are treated by the court system and cracks down on the trafficking of the deadly synthetic opioid fentanyl.

Rep. Claire Cronin, the House chair of Judiciary Committee and the branch's lead negotiator, said that the bill broadly aims to reduce recidivism, enhance public safety and save money for taxpayers by diverting people that would otherwise be sent to prison to treatment and other programs.

The compromise bill (S 2371), which marries competing versions that passed the House and Senate last year, will move first to the Senate floor where a vote is not expected until the first week of April.

The House will then get to debate and vote on the final package before it reaches Gov. Charlie Baker's desk for his consideration. The report, which was filed with the Senate clerk on Friday, cannot be amended under legislative rules.

The bill would eliminate a handful of mandatory minimum sentences for what lawmakers described as "low-level drug offenses," including first and second offenses for cocaine possession.

While the conference committee did not raise the age of juvenile court jurisdiction from 18 to 19, it did remove juvenile court jurisdiction over minors aged 7 through 11 years old, preventing anyone under the age of 12 from being prosecuted criminally in the courts.

Some crimes committed by offenders up to age 21 would be eligible for expungement, under the bill, while adults would also be able to apply to have their records expunged of crimes that are no longer considered illegal in Massachusetts, such as possession of marijuana.

"The agreement we've reached is about lifting people up, not locking them up," said Sen. William Brownsberger, a Senate chair of the Judiciary Committee and Cronin's counterpart on the conference committee.

The bill also makes reforms to the bail system and court fees and fines, lifts the threshold for felony larceny from $250 to $1,200 and creates new penalties for repeat offenders who are charged with their sixth, seventh, eighth or ninth operating under the influence violation.

Brownsberger, who published an outline of the compromise online on Friday, said the conference committee opted against changing the state's statutory rape laws, which was one of the more sensitive topics of debates when the bills were last considered in the House and Senate.

The bill would prevent the use of solitary confinement in prisons for juveniles and pregnant women.

"Other bills made small dents. This makes a big bang," said conferee Sen. Cynthia Creem said.

This is a developing story.