Shorter sentences for federal prison sentences may be on the horizon, with President Trump's blessing.

Trump endorsed new legislation Wednesday that would reduce some federal sentences, arguing it's "the right thing to do" and that only "truly bad criminals" deserve harsh penalties.

"Today's announcement shows that true bipartisanship is possible, and maybe it will be thriving," Trump said at the White House.

[Opinion: Trump is right to embrace criminal justice reform]

The reforms are included in bipartisan Senate legislation called the First Step Act. The bill has evolved in time, passing the House of Representatives earlier this year after sentencing reforms were axed at the behest of some Republicans.

Trump's endorsement of a more robust version including both prison and sentencing reform gives it significant momentum, fresh off Trump's firing last week of Attorney General Jeff Sessions, who long resisted softening harsh drug laws.

"It's my honor to be involved, and it will be an even greater honor to sign," Trump said, telling lawmakers to "go out and see if you can get that done."

"I'll be waiting with a pen, and we will have something that hasn't been done in many many years, and it's the right thing to do," he said.

Trump recalled his June decision to commute drug convict Alice Johnson's prison sentence, repeating his often-made argument that some prisoners are victims of unfair sentencing.

Bill provisions include shortening federal three-strike drug penalties from life in prison to 25 years, reducing two-strike drug penalties from 20 years to 15, allowing a firearm sentencing enhancement to run concurrently with the underlying penalty, and allowing retroactive sentencing for crack cocaine cases judged under tougher historical laws.

"The legislation fixes some longstanding problems in the federal criminal justice system," said Joe Luppino-Esposito, director of rule of law initiatives at the Due Process Institute. "President Trump wants law enforcement to expend its resources on stopping violent criminals and drug cartels, not warehousing small-time, nonviolent drug offenders."

The prison-reform components of the First Step Act aim to make it easier for inmates to re-enter society. The bill would bar pregnant women from being shackled, expand good-time credit, and mandate that prisoners be placed near family.

"The genius of this bill is that it re-focuses on the primary purpose of prison: rehabilitating and correcting criminal behavior," said Luppino-Esposito. "Prisons often make inmates become more dangerous, especially those who are low-level, nonviolent offenders — the research has told us that for years."

Luppino-Esposito said that some key reforms already have been adopted by states and that "the First Step Act will greatly improve recidivism rates, just as we've seen work in Texas and a number of other red states."

The Washington Examiner reported many of the bill's details earlier this month. To head off conservative concern, the bill specifies that expanded time-off credit doesn't apply to noncitizens subject to a deportation order, according to a leaked version published Tuesday.

Senate Majority Leader Mitch McConnell, R-Ky., vowed a whip count following the midterm election, but the precise level of support is not publicly reported.

“From what we understand, there are enough votes — plenty — for it to happen,” Mark Holden, the general counsel of Koch Industries and an influential conservative reform advocate, recently told the Examiner.

Jessica Sloan, a leader of the reform group #cut50 who attended Trump's remarks at the White House, told the Washington Examiner on Wednesday that she believes recent endorsements from law enforcement groups significantly improved the bill's outlook.

Those law enforcement endorsements were cited by Trump, who noted that the Fraternal Order of Police and the International Association of Chiefs of Police were among the new backers.

It's not immediately clear how hawkish senators such as Sen. Tom Cotton, R-Ark., will respond to the legislation, or whether it is robust enough to satisfy more progressive members who had balked at prison reform legislation that did not include sentencing.

Trump said the new bill undoes some harsh sentencing provisions passed under President Bill Clinton "that disproportionately harmed the African-American community," calling Clinton-era penalties "very disproportionate and very unfair."

"Work hard and act quickly and send a final bill to my desk," Trump said. "Americans from across the political spectrum can unite around prison reform legislation that will reduce crime while giving our fellow citizens a chance at redemption, so if something happens and they make a mistake, they get a second chance at life."