President Trump on Friday signed a sweeping bipartisan criminal justice bill amid ongoing partisan rancor over a stopgap spending measure that could lead to a partial government shutdown by the end of the day.

In a ceremony at the White House, Trump touted the First Step Act a day after the House overwhelmingly approved the most far-reaching overhaul of the criminal justice system in a generation.

The new law, which shortens sentences for some offenders and expands job training and other programs for prisoners, reflects a major pivot by the GOP from its punitive, law-and-order stance of the 1980s to policies that emphasize rehabilitation and aim to save money.

Though hailed as a bipartisan achievement, only one Democratic lawmaker — Sen. Sheldon Whitehouse of Rhode Island — was among those who joined Trump at the Oval Office event on Friday.

The event came during another chaotic day in Washington that began with Trump taking to Twitter to try to blame Democrats for a potential government shutdown that last week he said he would proudly own if Congress did not provide at least $5 billion in funding for his long-promised border wall.

Trump tweeted shortly after the criminal-justice legislation passed on Thursday, touting what he called “a great bi-partisan achievement for everybody.”

“When both parties work together we can keep our Country safer,” he said. “A wonderful thing for the U.S.A.!!”

The new law will change several sentencing laws, such as reducing the “three strikes” penalty for drug felonies from life behind bars to 25 years and retroactively limiting the disparity in sentencing guidelines between crack and powder cocaine offenses. The latter could affect about 2,000 federal inmates.

It also overhauls the federal prison system to help inmates earn reduced sentences and lower recidivism rates.

Through reductions in sentencing, the law, which does not cover state jails and prisons, would do the equivalent of shaving a collective 53,000 years off the sentences of federal inmates over the next 10 years, according to the Congressional Budget Office — though some advocacy groups dispute this figure. There were about 181,000 federal inmates as of Dec. 13, according to the Bureau of Prisons.

A similar move has been afoot in many states as crime rates have dropped and officials have pursued cost-effective ways to cut the prison population.

The bill received a boost last month when Trump endorsed it as “reasonable sentencing reforms while keeping dangerous and violent criminals off our streets.” His thinking was heavily influenced by his son-in-law and White House adviser, Jared Kushner, who has long advocated sentencing restructuring and marshaled endorsements of the bill from a diverse coalition, including law enforcement and the American Civil Liberties Union.

Trump recognized Kushner for his efforts, telling those in the Oval Office that he “has worked so hard on this.”

Kushner said the legislation was the product not only of people in the room. “This really took an army of a lot of other people,” he said.

His wife, Ivanka Trump, who also serves as a White House adviser, said that with the bill now signed, “maybe I’ll get a little bit more time with him now.”

The bill’s passage was a personal victory for Kushner at a time when he has faced difficulties on other fronts, including scrutiny in recent months for his friendship with Saudi Arabia’s crown prince, Mohammed bin Salman.

For years, Kushner has been advocating to overhaul sentencing laws — an issue he looks at through a deeply personal lens because his father was incarcerated for more than a year at a federal prison in Alabama a decade ago.

Kushner spent months quietly pressing Trump to prioritize criminal justice policies, carving out time on his father-in-law’s schedule for meetings on the topic — including an October visit to the Oval Office by rapper Kanye West and his wife, reality-television star Kim Kardashian West, both outspoken reform advocates.

Kushner personally rallied key Republican and Democratic lawmakers to support the bill, which he pitched to the president as a rare bipartisan deal, and persuaded Senate Majority Leader Mitch McConnell (R-Ky.) to bring it to a vote.

Philip Rucker and Seung Min Kim contributed to this report.