Legislation now goes to the House where it is expected to pass before being signed by President Donald Trump.

The Senate passed a sweeping criminal justice bill late on Tuesday that 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.

By a vote of 87-12, the Republican-led Senate passed and sent to the House of Representatives the First Step Act, which would ease the way for some prisoners to win early release to halfway houses or home confinement.

The Senate passage of the bill culminates years of negotiations and gives President Donald Trump a signature policy victory, with the outcome hailed by scores of conservative and liberal advocacy groups. The House is expected to pass the bill this week, sending it to the president’s desk for his signature.

The Senate legislation aims to establish programmes to head off repeat offenders and protect first-time non-violent offenders from harsh mandatory minimum sentences.

Earlier this year, the House passed a bipartisan bill focusing on prison reforms, which did not include sentencing reforms.

Trump congratulated the Senate on passing the bill and said he looked forward to signing it into law.

“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,” Trump tweeted.

2.2 million people imprisoned

The United States leads the world in the known prison population, with about 2.2 million people jailed at the end of 2016.

During Senate debate of the bill, Democratic Senator Dick Durbin noted the US had five percent of the world’s population, but 25 percent of the world’s known prison population.

He added that minority groups bore the brunt of tough minimum sentences that judges have been directed to impose as a result of a decades-old law that has exploded the numbers of jailed people.

“The majority of illegal drug users and dealers in America are white. But three-quarters of the people serving time in prison for drug offences are African American or Latino,” Durbin said.

Inmates walk the exercise yard at the California Medical Facility in Vacaville, California [Rich Pedroncelli/AP Photo]

In response to criticism from some conservatives that the legislation could prompt the release of violent criminals into society, the bipartisan measure was reworked to scale back the discretion judges would have in some sentencing cases.

Before passing the bill, the Senate defeated amendments by Republican Senators Tom Cotton and John Kennedy that would have further tightened requirements.

Those amendments would have excluded child molesters and other violent felons from early release, required notification of victims before offenders are let out of prison early and included a plan to track the effectiveness of anti-recidivism programmes.

If the bill is passed by the House and signed by Trump, it will be seen as a major victory for advocates who have worked for years on similar pieces of reform legislation but were continually blocked by conservatives and scepticism within the Republican leadership.

Years in the making

The vote in the Senate was all but uncertain until Senate Majority Leader Mitch McConnell announced the chamber would take up the bill before the end of the year. McConnell had previously refused to give a vote to a more expansive bill introduced during the presidency of Barack Obama.

McConnell’s announcement this month about the vote came after Trump threw his support behind the legislation in November, urging McConnell to bring the bill to a vote.

Senate Majority Leader Mitch McConnell (R-KY) (L) and Sen. Cory Gardner (R-CO) head to the floor to vote to begin debate on a bipartisan criminal reform bill [Chip Somodevilla/Getty Images/AFP] [Daylife]

The year’s bipartisan negotiations brought together politicians across the political spectrum and advocacy and rights groups on opposing sides.

The American Civil Liberties Union said on Twitter it was “glad to see common sense prevail in the Senate voting to move this bill closer to the finish line”.

The advocacy group added that the legislation is “by no means perfect – but we’re in the midst of a mass incarceration crisis and the time to act is now”.

Jason Pye, the vice president of legislative affairs at FreedomWorks, a conservative advocacy group, called the senate vote “historic”, and urged the House to pass the bill so it can be signed by the president.

Other groups that supported the bill included the Fraternal Order of Police, the Center for American Progress and the Koch brothers, among others.