The Senate passed a bipartisan criminal justice reform bill known as the First Step Act on Tuesday by a vote of 87-12.

Although President Donald Trump supported the legislation, 12 Republicans voted against it, The Hill reports. The bill will need to be passed in the House, which is expected to happen, before the president can sign it.

The bill was passed with the help of Jared Kushner, Trump's son-in-law, who has been lobbying senators to support the legislation. Earlier this month, the president urged Senate Majority Leader Mitch McConnell (R., Ky.) to bring the bill for a vote.

Sen. Chuck Grassley (R., Iowa), who chairs the Senate Judiciary Committee, said the bill was "an opportunity for a Republican majority in the United States Senate to show that this Republican president can do something that even President Obama couldn’t get done."

Among the senators who opposed the bill were Sens. Tom Cotton (R., Ark.), John Kennedy (R., La.), and Ben Sasse (R., Neb.).

Earlier in the day, senators voted down proposed amendments from Cotton and Kennedy that would have expanded a list of offenses making one ineligible for credits to reduce prison sentences and required victims or families of victims to be notified when someone is released.

Sens. Dick Durbin (D., Ill.) and Cory Booker (D., N.J.) encouraged fellow Democrats to support the bill. No Democratic senators voted against the legislation, which was championed by liberal CNN host and former Obama administration official Van Jones.

The bill introduces a number of reforms to the criminal justice system, and notably introduces a means for prisoners to earn credits towards an "early prerelease custody in exchange for participation in recidivism reduction programs."

Sasse expressed concern that the bill would release "thousands of violent felons very early," calling that "a grave mistake that will hurt innocent Americans."

Durbin acknowledged the bill was not perfect but said it was a "product of compromise."

"We’ve worked long and hard on this. We’ve had policy groups, prosecutors, civil liberties groups. All have carefully reviewed this. No one is getting what they wanted completely. This is a product of compromise. But that’s how you pass a bill in the United States Senate," Durbin said.