WASHINGTON – Alex Gudich and the team from #cut50 weren’t taking any votes for granted. They spent Tuesday knocking on the doors of senators and urging them to support a criminal justice reform bill up for a vote, something they didn't know would happen that night.

"To see it actually happen was an incredible moment,’’ said Gudich, deputy director for the national advocacy group, who watched from inside the chamber as the Senate passed the bill. "We’re here at a very, very pivotal moment."

In a major step in the criminal justice reform effort, the Senate voted 87 to 12 late Tuesday to approve the bipartisan "First Step Act" pushed by Sens. Chuck Grassley, R-Iowa, Dick Durbin, D-Ill., Mike Lee, R-Utah and Cory Booker, D-N.J. The bill must now go over to the House for a vote, where it is expected to pass. President Donald Trump has supported the measure and said he would sign it into law.

"America is the greatest Country in the world and my job is to fight for ALL citizens, even those who have made mistakes," Trump tweeted Tuesday after the vote. "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."

Grassley, one of the bill's champions, called the bipartisan vote and overhaul of the criminal justice system something that "happens once in a generation" in a victory tweet late Tuesday.

The measure aimed at reducing the number of people in the nation’s prisons would among other things, give judges more discretion in sentencing offenders for nonviolent crimes, particularly drug offenses, and bolster rehabilitation programs for former prisoners.

Before the vote, the Senate defeated amendments proposed by Republican Sens. Tom Cotton of Arkansas and John Kennedy of Louisiana that would have required the Bureau of Prisons to notify victims before a prisoner is released and tracked former offenders after they're released.

“While the bill has marginally improved from earlier versions, I’m disappointed my amendments to exclude child molesters from early release and to protect victims’ rights were not adopted,'' Cotton said in a statement. ”

.

More:Here's what's in the criminal justice reform bill now headed to a vote in the Senate

Opinion:Vote on FIRST STEP Act to reform 'out of whack' prison sentences

More:Criminal justice system reform: Trump, senators on board, so what's the holdup?

Several advocacy groups, including #cut50, and national civil rights groups, including the National Urban League, have been a part of a massive push to get the legislation passed.

“It’s been a long time in raising the awareness of how the system of mass incarceration is so destructive and needs to be fixed and reformed,” said Marc Morial, president of the National Urban League. “There’s been a lot of groundwork that has been laid over the years.”

The groups have been working on criminal justice reforms for years, including under then-President Barack Obama, but supporters said the effort got a boost earlier this year with the help of Jared Kushner, President Donald Trump's son-in-law and senior adviser.

“We were excited to see a breakthrough this year and a shift," Gudich said.

In the days leading up to Tuesday's vote, #cut50 visited Democratic and Republican lawmakers again to rally for support. Members of the group have been to Washington about 30 times this year.

“The adrenaline has kept us going," Gudich said.

The first stop for #cut50 Tuesday was the office of Sen. Cindy Hyde-Smith, a Republican from Mississippi, who attended a roundtable last month on criminal justice reform with Trump on criminal justice on the eve of her election. Hyde-Smith later voted for the bill calling it "a solid step toward making much-needed reforms on the federal level."

More:Criminal justice reform: An inside look at how Donald Trump and Congress got to 'yes'

More:Mitch McConnell, in reversal, says Senate will vote on criminal justice bill

Some advocates, however, have complained the measure doesn’t go far enough.

Morial said he would have wanted more provisions to deal with bail reforms and more support for reentry programs, but welcomes the effort.

“If we could get a perfect comprehensive bill, we’d do it," he said. “This bill is also the product of some difficult political trade-offs. But it’s better to move this bill with all the things it does than to sit back and wait. We could end waiting another three to four years."

Lawmakers particularly praised the work and input of advocates and civil rights groups.

“Formerly incarcerated individuals were incredibly important voices in urging the House to get something meaningful done on prison reform,’’ said New York Rep. Hakeem Jeffries, incoming House Democratic Caucus chair, and a key negotiator in the effort.

Indeed, formerly incarcerated people from a host of groups, including #cut50, Prison Fellowship, the National Council for Incarcerated and Formerly Incarcerated Women and Girls, have lobbied Congress to support reforms.

Louis L. Reed, national organizer for #cut50, said passage of the bill was personal.

“I know what it’s like to be in a six by nine cell and have bills passed and to have your hopes dashed because the bill has no applicability to you,’’ said Reed, who served 14 years in prison. “This is something that every single person who is in federal custody is going to benefit from.”

Civil and voting rights groups, including the NAACP and the ACLU, have also been key players along with a host of conservative groups .

“We as conservatives share common goals,’’ Kevin Roberts, executive director of the Texas Public Policy Foundation, said during a press conference last week. “We want strong communities and institutions. We want those who have done wrong to be punished and then to seize their own redemption without state interference. Most of all we want safe neighborhoods.”

Morial applauded the passage of the First Step Act, but said more needs to be done.

“This is something that we have to work on over time. This bill is a good bill, but this not going to be the last effort at criminal justice reform,’’ he said. “There’s already a lot of movement at the state level…This is a growing movement in America – the idea that we have to fix the system of mass incarceration.”

Contributing: Eliza Collins, Christal Hayes