Hours before a partisan divide was set to force a partial government shutdown, President Donald Trump signed the most sweeping bipartisan initiative of his presidency—a criminal justice reform bill.

Trump signed the First Step Act, geared toward helping to integrate prisoners into society after they serve their sentence.

At the bill signing, after talking at length about the need for border security and the potential government shutdown, Trump shifted to talking about the significant accomplishment of the reform.

“Now, to a very positive note: Criminal justice reform—everybody said it couldn’t be done,” Trump said. “They said the conservatives won’t approve it. They said the liberals won’t approve it. They said nobody was going to approve it, everybody is going to be against it. It has been many, many years, numerous decades, and nobody came close.”

Trump, thanked Republican leaders, also House and Senate Democratic leaders Nancy Pelosi, of California, and Charles Schumer, of New York—even as he later blamed Democrats for the shutdown.

“I want to thank Nancy and Chuck, as I said, affectionately. I do,” Trump said. “I want to thank everybody. This was incredible bipartisan support.”

The First Step Act is an acronym for the Formerly Incarcerated Re-enter Society Transformed Safely Transitioning Every Person Act.

Lawmakers, mostly Republican, flanked the president at the bill signing. Several spoke. Sen. Ted Cruz, R-Texas, called the new law “a great step in the correction of justice,” and praised his colleague Sen. Mike Lee, R-Utah: “Mike bled for this bill.”

One Democrat, Sen. Sheldon Whitehouse of Rhode Island, attended the bill signing.

The new law will allow inmates convicted of nonviolent crimes, if they complete certain education and training programs, to earn credits toward spending more of their sentences in supervision outside prison, in a halfway house, or in home confinement.

“This legislation will increase the access of faith-based and nonprofit organizations, like Prison Fellowship, to provide desperately needed programming in the federal prison system and help reduce recidivism,” said James Ackerman, president of Prison Fellowship, a Christian nonprofit devoted to aiding prisoners, in a statement.

“From our work in many states across the country, we can say without hesitation that these programs restore lives—putting people on a new path and eventually reduce crime.”

Conservative organizations such as The Heritage Foundation and FreedomWorks, as well as the liberal Brennan Center for Justice and the American Civil Liberties Union, oppose mandatory minimum sentencing.

“By enacting the First Step Act, President Trump and conservative leaders in Congress earned a bipartisan victory for public safety, the economy, and American values,” John-Michael Seibler, a legal fellow for The Heritage Foundation, told The Daily Signal.

The new law is aimed at aiding prisoners who served their sentence with getting a job and more easily transitioning back into society.

“With the passage of this long-overdue legislation, individuals who have paid their debt to society and have taken steps to better themselves will have the opportunity to reunite with their families and they’ll have the skills necessary to contribute to their communities as they re-enter society,” said Kay Coles James, president of The Heritage Foundation, in a statement after the House passed the measure Thursday.

Several conservative and liberal organizations are backing the bill, co-sponsored by Reps. Doug Collins, R-Ga., and Hakeem Jeffries, D-N.Y., which is geared to preparing inmates to re-enter society with job skills and reduce the rate of their return to prison.

“By passing the First Step Act, lawmakers are backing long-overdue fixes to some of the most broken parts of our justice system that for too long have been overly-punitive and downright unfair,” Inimai Chettiar, director of the Justice Program at the liberal Brennan Center for Justice at NYU School of Law, said in a statement.

Former Virginia Attorney General Ken Cuccinelli, who has been a leading spokesman for Right on Crime, a coalition of conservative groups backing the initiative, praised the timing of the bill’s passage—just days before Christmas.

“In this season of hope and renewal, Congress has given many people another reason to be hopeful by passing the First Step Act,” Cuccinelli said in a statement. “This major, bipartisan victory is the culmination of years of work by lawmakers, law enforcement, faith leaders, and advocacy groups across the political divide. As 95 percent of people who enter prison will one day leave, this bill provides the opportunity for redemption—not just punishment.”

Former House Speaker Newt Gingrich said the bill will “fix well-intended but damaging” crime policies.

“The so-called ‘three strikes’ law will be changed so it applies only to serious drug felons and serious violent felons—rather than anyone charged with trafficking drugs,” Gingrich said in a statement.

Senate Judiciary Chairman Charles Grassley, R-Iowa; House Judiciary Chairman Bob Goodlatte, R-Va.; Senate Majority Leader Mitch McConnell, R-Ky.; and Senate Majority Whip John Cornyn, R-Texas, played the key role in pushing the legislation across the finish line.

“America now stands to benefit from the most significant federal criminal justice reform in a generation, thanks to the leadership of the Trump administration, Sens. Grassley, Cornyn, and McConnell, and Reps. Collins and Goodlatte, among other members of Congress, and a broad coalition of law enforcement professionals, business groups, and others,” Seibler said.

Still, the partisan angst continues. The House voted to approve $5 billion as part of a spending bill to keep the government running into February.

During the bill signing ceremony, Trump said he hopes there isn’t a government shutdown. Trump said the House vote Thursday was a “tremendous evening for the Republicans.”

“Now it’s up to the Democrats as to whether or not we have a shutdown tonight,” Trump said.

However, Senate Democrats say they will block the funding. Measures need 60 votes to overcome a Senate filibuster. This will lead to a partial government shutdown.

However, this would have a more minimal impact than previous shutdowns, as 75 percent of the government has already been funded. A shutdown would mean 25 percent of some services carried across the departments of Agriculture, Commerce, Justice, Homeland Security, State, and Transportation would lack funding.