Eliza Collins, Deborah Barfield Berry and Herb Jackson | USA TODAY

WASHINGTON – Senate Majority Leader Mitch McConnell, in a shift, announced Tuesday the Senate would take up a long-awaited bipartisan bill that aims to reduce the number of people in the nation's crowded prisons.

"At the request of the president and following improvements to the legislation that have been secured by several members, the Senate will take up the revised criminal justice bill this month," the Kentucky Republican said. He said he would turn to it as early as the end of the week.

An unusual coalition of Republicans and Democrats, civil rights groups and small-government conservatives have pushed for action on the Senate bill called the “First Step Act." President Donald Trump also backs it.

The effort to pass a Senate bill had stalled as McConnell remained reluctant to bring it to a floor vote by the end of the year. Then pressure began to mount on him from Trump and other Republican senators.

The measure would give judges more discretion in sentencing offenders for nonviolent crimes, particularly drug offenses, and bolster rehabilitation programs for former prisoners. It would also call for placing federal prisoners closer to home – no more than 500 miles – so families could visit more often.

Trump welcomed McConnell's announcement.

“Looks like it's going to be passing, hopefully – famous last words,'' Trump said at the White House. "It’s really something we're all very proud of. Tremendous support from Republicans and tremendous support from Democrats. Lot of years they've been waiting for it.”

The measure has faced fierce opposition from some Republicans, including Sen. Tom Cotton of Arkansas, who said it would free too many prisoners, including violent felons.

Cotton said he looked forward to debating a revised measure and introducing amendments to address his concerns, including the early release of felons who commit certain crimes.

"Unfortunately, the bill still has major problems and allows early release for many categories of serious, violent criminals,'' he said in a statement Tuesday.

Alex Brandon, AP

Republican leaders had said there wasn't enough support within the party to pass the measure, but support grew. By Monday, at least 34 senators – Democrats and Republicans – had signed onto the bill.

“We have the votes. We’re very confident,” George Hartmann, a spokesman for Sen. Chuck Grassley, R-Iowa, chairman of the Judiciary Committee, told USA TODAY on Tuesday.

Senate Majority Whip John Cornyn, R-Texas, and Sen. Rand Paul, R-Ky., both supporters of criminal justice changes, predicted the bill would pass.

"I think you’ll see a number of Republicans now come on board supporting this bill as amended,'' Cornyn said. "The fact that people now know we’re going to vote on it is going to cause people to have to make decisions."

Paul, who has co-sponsored several of his own criminal justice bills, said he expects close to 80 votes for the bill.

Grassley, one of the lead sponsors, and Sen. Dick Durbin, D-Ill., launched a full-court press for action on the measure. Vice President Mike Pence and Jared Kushner, Trump's son-in-law and senior adviser, visited the U.S. Capitol to rally Senate Republicans.

Chip Somodevilla, Getty Images

The bipartisan group of senators made some tweaks, securing support from more conservatives, including Sen. Ted Cruz, R-Texas, and Sen. David Perdue, R-Ga.

The House passed a criminal justice bill this year, but advocates have complained it didn't address the controversial issue of mandatory minimum sentencing.

In early fall, McConnell told the Senate bill's co-sponsors that if they garnered 60 votes, he would bring it up for a vote. Even after the group surpassed that number, McConnell didn’t budge.

McConnell said on the Senate floor Tuesday it was Trump’s support, along with “improvements” to the bill, that allowed him to bring it to the floor.

Sen. Cory Booker, D-N.J., a key player in the criminal justice debate, said there were discussions underway about details of the bill, but he was optimistic any issues would be ironed out.

"I just talked to the White House earlier, moments ago, and we’re going to keep working until we get it done," he said.

Booker credited Kushner with helping reach a compromise and getting support for the bill. "I don’t think this would have happened without him,” he said.

Deborah Barfield Berry, USA TODAY

The effort is not new. Republican and Democratic lawmakers pushed for years to overhaul the criminal justice system, but efforts stalled over issues such as mandatory minimum sentencing.

“We’ve never been closer," Sen. Mike Lee, R-Utah, said last Tuesday at a panel hosted by the Washington Post Live Center. “There’s no reason why we shouldn’t take a vote. This bill needs to pass this year."

Sen. Doug Jones, D-Ala., agreed.

“When you get all of those people to agree on the same piece of legislation, it’s a no-brainer that we should get a vote,’’ he told USA TODAY. “We’ve got the opportunity to make this important step, and we can’t keep kicking the can down the road on such an important issue."

Supporters of a criminal justice overhaul said action on legislation is long overdue.

“Mass incarceration is probably one of the largest civil rights atrocities that currently exist,'' said Inimai Chettiar, director of the Justice Program at the Brennan Center for Justice.

The effort to at least begin overhauling the criminal justice system was applauded.

“What’s important is that if Washington does it, I think it encourages more states to do it as well,” Chettiar said.

Facing a busy legislative agenda, McConnell said senators should be prepared to work during the holiday week if necessary.