WASHINGTON — Under pressure from President Donald Trump and many of his Republican colleagues, Senate Majority Leader Mitch McConnell said Tuesday that he will bring legislation to the floor to overhaul the nation’s sentencing laws.

McConnell’s decision comes after more than three years of overtures from a large, bipartisan group of senators who support the criminal justice bill, including Senate Judiciary Committee Chairman Chuck Grassley and House Speaker Paul Ryan. Trump announced his support for the legislation last month, but McConnell treaded cautiously and said the bill was among a number of competing priorities for the lame-duck session.

Texas Sen. John Cornyn, the No. 2 Republican, said Trump’s push for the legislation had been “critical to the outcome here.”

“Senator McConnell was always concerned about the small window of time that we have to do all these things we need to do, but the president was insistent that this be included,” he said.

If the legislation passes, it could be a rare bipartisan policy achievement for this Congress and the largest sentencing overhaul in decades.

READ MORE: What Congress could accomplish in the lame-duck session

Most Democrats support the bill, which would revise 1980s and ’90s-era “tough on crime” laws to boost rehabilitation efforts for federal prisoners and give judges more discretion when sentencing nonviolent offenders, particularly for drug offenses. Supporters say the changes would make the nation’s criminal justice system fairer, reduce overcrowding in federal prisons and save taxpayer dollars.

The legislation has been a priority for Trump’s son-in-law, Jared Kushner, who has worked behind the scenes with supportive Republican senators over the last two years and pushed Trump to support it. It was also a top issue for former President Barack Obama, who had hoped to see the bill become law before he left office.

Supporters have long said that the bill would pass if McConnell would just put it on the floor. But McConnell appeared to have concerns that it would divide his caucus. One vocal GOP opponent, Sen. Tom Cotton of Arkansas, has criticized the bill as allowing for early release of serious and repeat felons.

McConnell said he was moving the bill as soon as this week “at the request of the president” and following improvements to the legislation. A revised bill makes some changes requested by Senate Republicans and law enforcement groups who had concerns it would be too soft on some offenders.

Cornyn announced Tuesday morning that he had requested changes to the bill to bring on more Republicans. He said one of the changes was to ensure that fewer firearms offenders got reduced sentences.

“My goal all along has been trying to grow the vote and gain support for the law enforcement community, and I think the bill has improved as a result, and I think the prospects for passage are much better,” he said.

Cornyn said similar sentencing reforms on the state level in Texas show that criminal justice overhaul can be successful.

“Texas is proof positive that you can close the revolving door of incarceration, reduce crime, and save taxpayer dollars at the same time,” Cornyn said.

It’s unclear how long it will take to move the bill. McConnell said senators should be prepared to stay in session the week following Christmas if necessary to complete their work.

Grassley has grown frustrated in recent days as he has questioned why McConnell wouldn’t move the bill in the final days of this Congress. And Trump has tweeted at McConnell to ask him to move.

“Hopefully Mitch McConnell will ask for a VOTE on Criminal Justice Reform,” Trump tweeted last week. “It is extremely popular and has strong bipartisan support. It will also help a lot of people, save taxpayer dollars, and keep our communities safe. Go for it Mitch!”

Hopefully Mitch McConnell will ask for a VOTE on Criminal Justice Reform. It is extremely popular and has strong bipartisan support. It will also help a lot of people, save taxpayer dollars, and keep our communities safe. Go for it Mitch! — Donald J. Trump (@realDonaldTrump) December 7, 2018

Minutes later Grassley tweeted that he and the president had spoken about “the growing support” for the legislation.

“Pres Trump told me he wants it done THIS CONGRESS,” Grassley tweeted.

Supporters who have been pushing the bill for years — including many law enforcement organizations, liberal advocacy groups and major GOP donors — were elated.

“It’s an incredibly groundbreaking moment and it’s really emotional for the broad coalition who has worked so hard on this legislation for so many years,” said Holly Harris, executive director of the advocacy group Justice Action Network. “I never doubted the leader would be on the right side of history on this bill.”

READ MORE: Pence and Kushner make push for criminal justice rewrite on Capitol Hill