Washington — The Senate voted 87-12 to approve a bipartisan criminal justice bill supported by President Trump on Tuesday evening. The House previously passed a version of the First Step Act, and now has to pass the Senate's version before the bill can go to Mr. Trump's desk for him to sign into law. The House is expected to give its OK this week.

The Senate voted to advance the measure on Tuesday morning. The bill was sponsored in the Senate by Republican Sens. Chuck Grassley and Mike Lee and by Democratic Sens. Cory Booker and Dick Durbin. It would ease federal sentencing laws for some criminal offenders.

Mr. Trump officially threw his support behind the bill in November, giving the legislation the push it might need to overcome the stall in the Senate.

Get Breaking News Delivered to Your Inbox

"Working together with my administration over the last two years, these members have reached a bipartisan agreement. Did I hear the word bipartisan? Did I hear, did I hear that word? That's a nice word, bipartisan agreement, on prison reform legislation known as the First Step," Mr. Trump said. "It's the right thing to do."

Mr. Trump son-in-law and senior adviser Jared Kushner, has been working with senators and private sector stakeholders to make improvements to the country's prison and sentencing policies, and has been acknowledged by members of both parties as key to securing White House support.

Mr. Trump tweeted his congratulations Tuesday night and wrote the bill "will keep our communities safer, and provide hope and a second chance, to those who earn it."

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.... — Donald J. Trump (@realDonaldTrump) December 19, 2018

....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! — Donald J. Trump (@realDonaldTrump) December 19, 2018

The bill gives judges more discretion when sentencing some drug offenders and boosts prisoner rehabilitation efforts. It also reduces 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 a reduced penalty.

Sen. Cory Booker, D-New Jersey, 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 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.

Republican Sen. Tom Cotton has been a vocal opponent of the bill, and added amendments which would have barred more felons from participating in the bill's earned-time credit program, along with other hard-line proposals. Those amendments were turned back Tuesday by the Senate.

Sen. Dick Durbin, D-Illinois, said the bill already carves out some 60 different 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."

Grace Segers and Peter Martinez contributed to this report.