A Trump-backed bipartisan criminal justice bill passed the Senate Tuesday night by a margin of 87-12, despite ongoing efforts by Sen. Tom Cotton and other hardline conservatives to sink it.

Why it matters: For years, advocates and lawmakers have worked to reform the federal prison system only to have their efforts fall apart at the last minute. But with the help of Jared Kushner in the White House and a bipartisan Senate coalition, the First Step Act has made it past the Senate and will now likely become law — impacting thousands of current federal inmates.

What's next: The bill is going back to the House, where it is also expected to pass. The House passed a less expansive version of the bill earlier this year. After that it'll head to the president's desk for signature.

Details: The bill would...

Send up to 4,000 prisoners home by increasing the amount of time inmates can cut off of their sentences due to good behavior.

Allow more male and female inmates to serve time in house arrest or halfway homes instead of prison cells, with exceptions for high-risk inmates.

Require that prisoners be placed within 500 miles of family.

Outlaw shackling during child birth.

Mandate the provision of sanitary napkins and tampons to female inmates.

Reduce the mandatory penalty from life to 25 years for a third conviction of certain drug offenses, and from 25 to 15 years for a second conviction.

Prohibit the doubling up, or "stacking," of mandatory sentences for certain gun and drug offenses.

Give judges more discretion in giving less than the mandatory minimum for certain low-level crimes.

Make the 2010 Fair Sentencing Act retroactive, which changed sentencing guidelines to treat offenses involving crack and powder cocaine equally. This could impact nearly 2,600 federal inmates, according to the Marshall Project.

The big picture: This bill would only impact the 180,789 people incarcerated in federal prisons, but many of the changes reflect reforms already implemented in many states.