The US Senate overwhelmingly passed a criminal justice reform bill backed by President Trump on Tuesday night.

The First Step Act passed on a vote of 87 to 12, with dozens of Republicans joining all the Democratic senators in approving the bill.

Trump congratulated the Senate in a tweet soon after it passed.

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

“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 bill would make sweeping changes to the criminal justice system if signed into law, including making it easier for some prisoners to earn early release to halfway houses and protecting first-time offenders from mandatory minimum sentences.

The bill was boosted by an endorsement by Trump, who was influenced by his son-in-law Jared Kushner in backing the reforms, according to the Washington Post.

The Senate version of the bill will now be sent to the House, which will have to pass it before it can reach the president’s desk to be signed into law. House Speaker Paul Ryan has expressed support for the bill.

With Wires