The election of Donald Trump looked like it would end momentum toward criminal justice reform. But as with many predictions about his presidency, this turned out to be wrong.

Criminal justice reform is a complicated subject, but it’s based on some simple ideas. The vast majority of prisoners will get out one day and return to their communities. It makes sense, therefore, to offer them treatment for problems such as drug addiction and mental illness, while also helping them with job skills and training. That way, they have a chance to make a go of life on the outside, rather than committing new crimes and returning to prison. To do otherwise is not just ineffective policy but counterproductive, because it means more crimes will be committed.

This philosophy is a rebuke, in other words, to the “tough on crime” policies that dominated discussion during the 1980s and 1990s. Back then, when murder rates were rising fast and the crack cocaine epidemic was rotting cities from within, politicians shied far from the idea that it was worth trying to rehabilitate prisoners. All they wanted to show criminals was a concrete cell and maybe a hammer they could use to bust up rocks. Providing any sort of helping hand to convicts came to be viewed as misguided mercy. Congress and the states adopted policies such as mandatory minimum sentencing laws that may have cut back on crime but certainly caused prison populations to soar.

As a candidate, Trump sounded like he came out of that more punitive tradition. He had long advocated for aggressive police tactics such as stop-and-frisk, in which New York cops patted down individuals for drugs and weapons on pretenses the courts ultimately considered dubious. In his 2000 book The America We Deserve, he said that “tough crime policies are the most important form of national defense,” making it essential that government “tranquiliz[e] the criminal element as much as possible.” He vowed in his acceptance speech at the Republican National Convention in 2016 to “liberate our citizens” from “the crime and violence that today afflicts our nation”; blamed President Barack Obama throughout the campaign for releasing violent criminals; and argued on Fox News that police could solve problems in cities like Chicago by “being very much tougher than they are right now.” He tweeted that “inner-city crime is reaching record levels” and pledged to “stop the slaughter going on.”

(Editor’s Note: President Trump threw his support behind a bipartisan bill to reform federal sentencing guidelines Wednesday, the details and politics of which we describe below)

Trump seemed ready to put his law and order campaign rhetoric into practice by installing Jeff Sessions as his attorney general. They’ve had their differences, but Sessions remains an active voice when it comes to criminal justice. As a senator, he presented one of the most significant roadblocks against a criminal justice reform bill that enjoyed broad bipartisan support but ended up dying toward the end of the Obama administration. Sessions warned that the bill “would release thousands of violent felons and endanger millions of Americans whose safety is increasingly threatened by rising crime rates.” As attorney general, Sessions has continued to take a hard line on crime and drug issues. Blaming Trump and Sessions for backward-looking policies, The New York Times editorialized that their approach represented “the undoing of justice reform.”

Not so fast. Despite all of this, Trump has instead emerged as an unlikely or at least surprising champion for criminal justice reform. “Many people made a big mistake assuming what Trump administration policies were going to be,” says Vikrant Reddy, a senior fellow at the Charles Koch Institute focusing on criminal justice reform and policing reform.

Trump may be instinctively anti-crime—he frequently cites his concerns about illegal immigration and gangs—but it turns out he has been open to new and less reactionary ways of fighting it. And that includes the system taking a more proactive role in prisoner rehabilitation. The real payoff is for society as a whole, which should expect higher percentages of ex-convicts to find employment and housing and become productive members of their communities—if they’re properly equipped—rather than just coming out “hardened” and destined to fall back on their worst proclivities.

A number of conservative groups have been preaching this gospel for years, including the Heritage Foundation, the American Conservative Union Foundation, FreedomWorks, Right on Crime, and R Street Institute, all of which have been quietly building a criminal justice coalition within the Republican Party. They helped convince the White House that it was time to pursue this course at the federal level, getting a direct channel with Trump.

The reform agenda has been shepherded by Jared Kushner, the president’s son-in-law and senior advisor. Charles Kushner, Jared’s father, was sentenced to two years in federal prison on charges of witness tampering, tax evasion, and illegal campaign donations, which helps explains his son’s political sensitivity on the incarceration issue, making it a personal priority in Trump’s first term.

Kushner has worked closely not just with conservative advocates, but with Democrats who are otherwise ideological enemies. He’s reached out personally to convicts and family members whose stories were publicized in the media. “Like many of the other leaders who are supporting this legislation, he was deeply impacted by his [family’s] experience,” says Jessica Jackson Sloan, national director of #cut50, a progressive criminal justice advocacy group. “It redefined what he thought of people who go to prison.”

Sloan co-founded #cut50 with Van Jones, a liberal commentator on CNN who worked for the Obama White House on green jobs, but has collaborated with Kushner and other Republicans such as Newt Gingrich on criminal justice reform. There’s mutual interest on this issue: liberals such as New York Democratic Representative Hakeem Jeffries, have decided to work with the administration on criminal justice reform at a time when it’s almost political suicide for them to be caught working with any Republicans at all, this president in particular.

But it’s Trump’s embrace of the issue that has helped quiet conservative critics who helped sink criminal justice reform proposals during the last Congress. Trump hosted a prison reform summit at the White House in May, offering the most flattering platform possible for advocates of the “smart on crime” approach. “Prison reform is an issue that unites people from across the political spectrum,” Trump said at the event. “It’s an amazing thing. Our whole nation benefits if former inmates are able to reenter society as productive, law-abiding citizens.” He promised, in his usual humble way, that America’s criminal justice system would emerge as “the best of its kind anywhere in the world.”

Four days later, the House overwhelmingly approved, 360-59, a prison reform bill. Among other things, the bill would authorize $50 million annually over the next five years for the Bureau of Prisons to spend on education, job training, and drug treatment programs. “While we recognize criminal behavior needs to be punished and criminals need to be incarcerated, we must also acknowledge that our prison population needs to be rehabilitated to the greatest extent practicable,” said Virginia Republican Representative Bob Goodlatte, chairman of the House Judiciary Committee. “The bill establishes a risk and needs assessment as the basis of both an effective recidivism reduction program and an efficient and effective federal prison system.”

A grand total of two House Republicans voted against the bill. Most of the opposition came from liberal Democrats who complained the bill did not go far enough. The Leadership Conference on Civil Rights and dozens of allied groups warned it did nothing to reform sentencing requirements or guidelines. “Meaningful reform,” they argued, requires both elements. “To reform America’s prisons, we must change the laws that send people to them in the first place,” former Attorney General Eric Holder argued in The Washington Post. “Anything less represents a failure of leadership.”

If the only critics of the House bill were Obama administration holdovers, a few liberal lawmakers, and groups on the left, their complaints wouldn’t matter much in today’s Washington. But some Republican advocates, too, believe that changes in prison practices must be coupled with amendments to sentencing laws.

Among their number is Senate Judiciary Committee Chairman Senator Charles Grassley of Iowa. “We need a more strategic approach to drug sentencing that focuses law enforcement resources on violent career criminals and drug kingpins instead of non-violent, lower level offenders,” he wrote in April. Working with Democrats such as Illinois Senator Dick Durbin, the Senate minority whip, Grassley has emerged as a key voice on criminal justice reform on Capitol Hill and his support is considered necessary, if not necessarily sufficient, to see any prison bill through the upper chamber.

While Grassley is a powerful advocate for sentencing reform, there are Republicans critics, not to mention Sessions and conceivably the president himself who could pose the most difficult roadblocks to legislation. “Frankly, sentencing reform would cause a lot of trouble in the House, especially with Republicans,” says Republican Representative Doug Collins of Georgia, the House bill’s lead sponsor. “But it also has problems with the president.”

Still, it’s possible that the easiest path forward for the bill on the Senate side would be to add a limited set of sentencing provisions, in order to get Democrats on board and satisfy Grassley, who in February helped to pass the Sentencing Reform and Corrections Act, along with New Jersey Democratic Senator Cory Booker and Republican Senator Mike Lee of Utah. That bill would reduce some mandatory minimum sentences, allow judges more discretion in certain cases, and reduce three-strike penalties for some offenders from life imprisonment to 25 years.

“If you add a couple of modest sentencing pieces, this thing gets across the finish line,” says Jason Pye, vice president of legislative affairs for FreedomWorks, of a possible compromise bill with the House. “That’s probably the only way this gets done.”

Since the summer, the White House has been negotiating with members of Congress to come up with a compromise that would be voted on following the midterm elections. It would incorporate some changes in sentencing law to satisfy Grassley and Senate Democrats, but without going so far as to drive away too many other Republicans. It’s a narrow path that has taken months to navigate, but advocates realize the odds look brighter for passage in a lame-duck session than they would in the new year, when the liberal position will likely be strengthened by expected Democratic gains in the House, throwing off the issue’s delicate bipartisan balance. “We believe they really want to get this done,” a House aide told The American Conservative. “The hope is everybody gets to yes, because everyone knows it will be harder in the next Congress.”

In Congress, it’s always easier to kill than to pass something. There’s a very low price to pay in Washington for doing nothing. But an idea that has support from across the political spectrum—and one that has become a domestic priority, at least in general terms, for the president—can’t be written off entirely. The fact that most of the complaints are about what’s not in the legislation, rather than what’s in it, is actually promising.

The percentage of adults supervised by some sort of correctional system in the U.S. (incarceration, probation, or parole) has dropped for nine straight years. In 2016, it was lower than it had been since 1993. The violent crime rate has fallen by just under half over that same period. Out of 1.5 million incarcerated individuals, about 190,000 are in federal custody. With states responsible for most prisoners and a majority of them having enacted some type of criminal justice reform, some say that the outcome in Washington ultimately doesn’t matter much. “The feds are way behind the states,” says Rick Raemisch, executive director of the Colorado Department of Corrections. “What they do is irrelevant to us.”

But that isn’t hindering momentum on Capitol Hill. Grassley has also joined with Republican Senator Orrin Hatch of Utah to address the issue of mens rea (Latin for “guilty mind”). In essence, they are worried about people who have been convicted of crimes they had no intent to commit. Their legislation would identify criminal statutes that lack a mens rea standard, giving agencies six years to issue rules clarifying when—and how much—intent is needed for enforcement. “There are more than 4,500 criminal laws on the books and more regulatory crimes than the Congressional Research Service was able to count,” Hatch and Grassley wrote in a Washington Examiner op-ed. “And when many of these crimes are drafted without clear criminal intent requirements, it becomes increasingly easy for unsuspecting Americans to be sent to jail for conduct they had no idea was against the law.”

Another idea being talked about on Capitol Hill is modifying section 851 of the criminal code, which allows prosecutors to double the mandatory minimum sentences sought for repeat offenders, or even increase the penalty to life. It was meant to be a tool used against hardened criminals, but prosecutors have often used it as a bludgeon to force plea deals from defendants who insist on their right to trial (a practice Holder clamped down on as attorney general). Another section being looked at is 924(c), which currently calls for adding jail time to sentences when a criminal carries or uses a firearm in connection with federal crimes such as drug trafficking. Prosecutors are sometimes required to “stack” charges under the code that add years to sentences against criminals who are not truly violent.

In one notorious case, Weldon Angelos was sentenced to 55 years in prison for selling marijuana, after a confidential informant said he had firearms in his possession and at his home. Even the judge who sentenced him called his punishment “unjust, cruel, and even irrational,” given that far shorter sentences are meted out to child rapists and hijackers. “Our provisions dealing with 924(c) are actually tougher on crime moving forward,” Senator Lee said at a Judiciary hearing. “This expands the application of 924(c) moving forward so it applies to violent offenders and not just drug offenders who are recidivists.”

The risk is that modifying sentencing enhancements, or digging deeper into the criminal code, could cost these bills as much support as would be gained. Some liberals are convinced, after a long drought, that this legislative effort is likely to be the last of its kind for a very long time, so they want to demand as much as they possibly can. Others recognize that any bill that can reach Trump’s desk is bound to be a compromise. “You don’t start cutting with the thickest part of the axe,” says Jessica Jackson Sloan of #cut50.

The House-passed bill’s formal title is an ungainly mouthful: the Formerly Incarcerated Reenter Society Transformed Safely Transitioning Every Person Act. It’s one of those convoluted titles meant to spell out an acronym, which in this case is the FIRST STEP Act. Backers say it’s just that—a first swing at this issue. Its passage, they say, wouldn’t be the final word on criminal justice reform, but rather offer proof of concept that Congress can actually pass something that addresses it.

“It doesn’t scratch every itch, even just in a prison reform context, but it’s a significant piece of legislation that moves the ball forward,” says Derek Cohen, director of Right on Crime.

In addition to increasing funding for vocational and rehab programs—which have long waitlists—the bill would help prisoners get ID or other documentation they’ll need to find jobs and housing on the outside. It would also direct the Bureau of Prisons to incarcerate convicts within 500 miles of their primary residence, since studies indicate that keeping prisoners within reasonable range of their families cuts down on recidivism. The bill would allow prisoners—those not convicted of sex offenses, terrorism, or some other serious crimes—to earn 10 days of time credits for every 30 days of educational, job training, or other risk reduction programming they complete, with bonuses if they’re repeatedly assessed at low risk levels for recidivism. The credited time could be served in home confinement, halfway houses, or under community supervision.

The bill would also increase the amount of “good time credits” inmates who avoid disciplinary problems can earn per year, from 47 days to 54 days. This provision would apply retroactively, meaning some prisoners could be released as soon as the bill goes into effect. That cost the bill the support of the Federal Law Enforcement Officers Association, which initially embraced the FIRST STEP Act. “Probation officers now are almost overwhelmed with the volume of outgoing prisoners,” says Patrick O’Carroll, the association’s executive director. “If a large amount of prisoners were released in bulk, the probation system would be overwhelmed.”

Will some version of the FIRST STEP Act make it through the Senate and into law? The answer to that question depends on who you ask, and on which day. Concerns about crime remain a near-constant in American politics, no matter what data may say about its decline or the effectiveness of “evidence-based” reentry programs. “I think the instinct is still there to punish groups harshly,” says Kevin Ring, president of Families Against Mandatory Minimums.

Some conservative senators are pushing for changes to the bill to make it seem less “soft.” Republican Senator Tom Cotton of Arkansas has praised the goals of the House bill but argues strongly against cutting sentences or giving judges more discretion. “That foolish approach is not criminal-justice reformit’s a jailbreak,” he wrote in The Wall Street Journal in August.

Such opposition is why it’s been tough to craft a compromise that adds sentencing changes to the House bill without endangering its passage in both the House and Senate. The final product is expected to be less ambitious than the Senate bill that failed under Obama. “Some of the legislation in play in that period was more aggressive,” says Cohen, the Right on Crime director. “Also, it sends a very strong signal that the president has put so much political capital behind this.”

Trump isn’t waiting for Congress to act. In March, he launched the Federal Interagency Council on Crime Prevention and Improving Reentry, directing a dozen cabinet departments and agencies to come up with strategies to address problems such as poverty, drug addiction and lack of educational and job opportunities, by way of improving the prospects for ex-cons. “To further improve public safety, we should aim not only to prevent crime in the first place, but also to provide those who have engaged in criminal activity with greater opportunities to lead productive lives,” Trump wrote in his executive order.

A week after the House passed its bill, Trump met in the Oval Office with Kim Kardashian West, the reality TV star. Commentators on the Left had a collective meltdown over the encounter, with The New Yorker calling it “a nightmare we can’t wake up from.” It turned out that Kardashian wasn’t there to discuss ratings or chat about her husband Kanye West’s pro-Trump tweets a month earlier.

She instead asked the president to grant clemency to Alice Johnson, a 63-year-old great-grandmother who’d been serving a life sentence since 1996 on a nonviolent drug offense. A few days later, Trump commuted Johnson’s sentence. In a statement, the White House said that Johnson “has been a model prisoner” over the past two decades, had worked hard to rehabilitate herself, and acted as a mentor to other inmates.

“I thought Kim Kardashian was great because she brought Alice to my attention,” Trump said. “We are looking at literally thousands of names of people that have come to our attention that have been treated unfairly or where their sentence is far too long.”

After pledging so often to put people away, Trump has come to recognize that under the right circumstances, it’s better to let some people out.

Alan Greenblatt, former reporter for Congressional Quarterly and NPR, writes about politics and policy for Governing magazine. This article was supported by a grant from the R Street Institute.