The U.S. Capitol Building in Washington on Jan. 21, 2018. (AP Photo/J. David Ake, File)

WASHINGTON (CN) – The Senate on Tuesday night passed a criminal justice reform overhaul, the culmination of years of work for lawmakers keen on changing the nation’s sentencing and prison procedures.

The bill, which has the backing of the Trump administration, cuts back on mandatory minimum sentences for certain crimes and broadens the instances in which judges can hand down sentences below the minimum. In addition, the bill makes retroactive a 2010 law that reduced the sentencing disparity between crack and powdered cocaine.

The other half of the bill focuses on prison reform, giving certain inmates the opportunity to earn early release by completing recidivism-reduction programs. Changes unveiled last week pared back the credits, making them off limits to people convicted of gun and fentanyl trafficking, domestic abuse and a list of other crimes.

Though the bill is a scaled-back version of similar legislation considered during the Obama administration, its passage Tuesday has earned praise from both liberals and conservatives.

“I don’t know whether we’ve had legislation like this before the United States Senate where you put together such a diverse group of people and organizations supporting the bill,” Sen. Chuck Grassley, an Iowa Republican who marshaled the bill, said on the Senate floor Tuesday evening.

Grassley explained in a floor speech before the bill passed the balancing act the bill’s proponents had to manage, adding measures to assuage the concerns of skeptical Republicans while keeping it in the favor of Democrats.

While the 87-12 vote on Tuesday evening was bipartisan, the measure faced opposition from conservatives who said it was too lenient on people convicted of crimes. Senators Tom Cotton, R-Ark., and John Kennedy, R-La., offered a series of amendments on Tuesday aimed at their concerns about the bill, including one that would have expanded the list of crimes that would make a prisoner ineligible for the time credits.

The Senate struck down those changes earlier on Tuesday evening before approving the bill. The House is expected to now approve the changes the Senate made before the package goes to President Donald Trump’s desk.

Trump’s support of the bill in October was key in reviving an issue that once seemed dead, as more Republicans came on board. Once hesitant to take a vote that would deeply divide his caucus, Senate Majority Leader Mitch McConnell, R-Ky., eventually agreed to allow a vote on the package before the end of the current Congress.

In a tweet Tuesday evening, Trump praised the passage of the bill.

“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. “Congratulations to the Senate on the bipartisan passing of a historic criminal justice reform bill. 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!”

