WASHINGTON — A criminal justice bill passed by the Senate would give judges more discretion when sentencing some drug offenders and would boost prisoner rehabilitation efforts and was hailed by scores of conservative and liberal advocacy groups.

The sweeping bill addresses concerns that the nation’s war on drugs had led to the imprisonment of too many Americans for non-violent crimes without adequately preparing them for their return to society. Its passage in the Senate, by an 87-12 vote on Tuesday, culminates years of negotiations and gives President Donald Trump a signature policy victory. The House is expected to pass the bill this week, sending it to Trump’s desk for his signature.

“America is the greatest Country in the world and my job is to fight for ALL citizens, even those who have made mistakes,” Trump tweeted moments after the Senate vote.

“This will keep our communities safer, and provide hope and a second chance, to those who earn it. In addition to everything else, billions of dollars will be saved. I look forward to signing this into law!” the Republican president added.

The vote also thrilled Democrats. New Jersey Sen. Cory Booker said the nation’s prisons are full of Americans who are struggling with mental illness and addiction and who are overwhelmingly poor. He said the nation’s criminal justice system “feeds on certain communities and not on others,” and he said the bill represents a step toward “healing” for those communities.

“Let’s make no mistake, this legislation, which is one small step, will affect thousands and thousands of lives,” Booker said.

The bill would reduce the life sentence for some drug offenders with three convictions, or “three strikes,” to 25 years. Another provision would allow about 2,600 federal prisoners sentenced for crack cocaine offenses before August 2010 the opportunity to petition for reduced penalties.

When the bill appeared to have stalled in recent weeks, Sen. Charles Grassley, the Republican chairman of the Senate Judiciary Committee, pleaded with Senate Majority Leader Mitch McConnell to bring it up for a vote. With Trump’s urging, McConnell eventually agreed, and he voted for the bill as well.

“The First Step Act,” Grassley said, “takes lessons from history and from states — our laboratories of democracy — to reduce crime, save taxpayer dollars and strengthen faith and fairness in our criminal justice system.”

The Senate on Tuesday turned back three amendments from Republican Sens. Tom Cotton of Arkansas and John Kennedy of Louisiana, who said the bill endangered public safety. Supporters voiced concerns that passing any of the amendments would have sunk the bill.

One amendment would have excluded more prisoners from participating in educational and training programs that allow them to earn credits that can then be used to gain earlier release to a halfway house or home confinement to finish out their sentences. Another amendment would have required that victims be notified before a prisoner gets that earlier release. The third would have required the Federal Bureau of Prisons to track and report the re-arrest rate for each prisoner who gets early release.

“While the bill has marginally improved from earlier versions, I’m disappointed my amendments to exclude child molesters from early release and to protect victims’ rights were not adopted,” Cotton said. “I also remain concerned that reducing sentences for drug traffickers and violent felons is a threat to public safety.”

Sen. Dick Durbin, D-Ill., said the bill already carves out some 60 crimes that make prisoners ineligible for early release to a halfway house or home confinement. He said Cotton’s amendment was too expansive and would prevent at least 30,000 prisoners from participation.

Durbin said the Federal Bureau of Prisons also gives victims the opportunity to be notified upon a change in the prisoner’s status, but it’s a choice. He said about 10 percent of victims choose not to be notified because of the trauma involved in revisiting the crime. Meanwhile, the amendment from Cotton and Kennedy would make it a requirement.

“Supporting the Cotton amendment is basically saying to these crime victims, ‘We’re going to force this information on you whether it’s in the best interest of your family, whether you want it or not,’” Durbin said. “That is not respectful of crime victims.”

The bill would affect only federal prisoners, who make up less than 10 percent of the country’s prison population.

An array of liberal and conservative advocacy groups rallied in support of the bill. For example, the Koch brothers-backed group, Americans for Prosperity, applauded senators for putting “policy ahead of politics.” The American Civil Liberties Union said the bill was “by no means perfect. But we are in the midst of a mass incarceration crisis, and the time to act is now.”

Law enforcement groups were more split. The bill was backed by the Fraternal Order of Police and the International Association of Chiefs of Police but opposed by the National Sheriffs’ Association. The union representing federal prison guards also joined in supporting the measure.

Your support is crucial…

With an uncertain future and a new administration casting doubt on press freedoms, the danger is clear: The truth is at risk.

Now is the time to give. Your tax-deductible support allows us to dig deeper, delivering fearless investigative reporting and analysis that exposes what’s really happening — without compromise.

During this holiday season, stand with our courageous journalists. Donate today to protect a free press, uphold democracy and ensure the stories that matter are told.

SUPPORT TRUTHDIG