A bipartisan bill aimed at overhauling federal prisons and reducing recidivism crossed a major hurdle on Tuesday when it was overwhelmingly approved by the Senate.

With the Senate's approval and the backing of President Trump, the legislation is now on the verge of becoming law.

The House, which passed a more modest version of the legislation earlier this year, is expected to take up the bill in the coming days.

Republican Speaker of the House Paul Ryan has already voiced support for the legislative package, pledging that the House is "ready to get it done."

The Senate voted 87-12 in favor of the bill known as the First Step Act. The passage of the bill by the chamber is a significant victory for advocates on the left and the right, who have pressed for Congress to take action to lower the prison population.

It's also a big win for the White House and for Trump adviser and son-in-law Jared Kushner, in particular. Kushner has made overhauling the criminal justice system one of his top projects in the White House.

After the Senate vote, Trump tweeted,"America is the greatest Country in the world and my job is to fight for ALL citizens, even those who have made mistakes. Congratulations to the Senate on the bi-partisan passing of a historic Criminal Justice Reform Bill."

For months, the fate of the legislation seemed to be in a precarious position. Republican Sen. Chuck Grassley, who helms the Senate Judiciary Committee, stressed that he wanted to include sentencing provisions, which had been left out of the version of the bill passed by the House in May.

For a while, it was unclear whether Trump would back measures to cut down on lengthy sentences. His first attorney general, Jeff Sessions, was staunchly opposed to the move.

But, with Sessions pushed out of the administration in November, Trump came out in favor of the more expansive Senate package.

Some Republicans, like Sen. Tom Cotton of Arkansas, still oppose the legislation, which they argue will free dangerous criminals.

Facing pressure from advocates and the White House, Senate Majority Leader Mitch McConnell agreed to bring the bill up for a vote during the lame-duck session after its sponsors agreed to certain changes.

Here are some highlights from the legislation:

Measures focused on changing U.S. prisons

-Provides more access to rehabilitation and training programs that are aimed at helping prepare prisoners for life after their release. Certain prisoners would be eligible for incentives if they participate, including credits that would allow them to spend up to a year of their sentences in facilities like halfway houses or at home under supervision.

Republican critics of these incentives argue that prisoners could commit crimes while on supervised release. But, the bill's sponsors say only offenders considered low or minimum risk would be eligible and the legislation excludes certain prisoners, including sex offenders and fentanyl traffickers.

-Makes it against the law to use restraints on pregnant inmates, unless they are an immediate threat to themselves or others or a flight risk.

-Requires that prisoners be incarcerated no more than 500 miles from their primary residence.

Measures focused on sentencing

-Ends automatic life sentences under the three-strike penalty for drug felonies. Instead of life, a third strike would now be a mandatory 25-year sentence. The mandatory sentence for a second offense would be reduced to 15 years compared to 20 years now.

This change would not be retroactive, so it would not help people already in prison serving life sentences under the three-strike rule. Some opponents of the bill have argued it does not go far enough to help people already affected by these laws.

-Expands the "safety valve" that allows judges to avoid imposing mandatory minimum sentences in certain cases.

-Addresses prisoners who were sentenced before laws were changed in 2010 to lessen disparities between the penalties for crack cocaine and powder cocaine. It would allow these prisoners to petition the courts to review their cases in light of the updated law.

Copyright 2018 NPR. To see more, visit https://www.npr.org.