President Barack Obama will be the first president in 36 years — since Jimmy Carter — to leave office with a smaller federal prison population than he inherited.

The Pew Research Center, using data from the Bureau of Justice Statistics, put out a chart showing what the historic drop looks like:

As the chart shows, the federal prison population still has a long ways to go before it returns to the much lower levels seen earlier in US history.

But the reversal is notable nonetheless. After decades of an escalating war on drugs and other “tough on crime” policies that helped turn the US into the world’s biggest incarcerator, the federal prison system is showing a real sign of change.

And the chart slightly underestimates the progress since it only goes through 2015, the latest year the Bureau of Justice Statistics has put data out for. In 2015, the federal prison population was down to 196,455. But by the latest estimates from the Federal Bureau of Prisons for January 2017, the federal prison population is at 189,333.

The shift downward is not thanks to an act of Congress, which failed to pass a much-anticipated criminal justice reform bill during Obama’s two terms. It’s in large part due to a decision by the US Sentencing Commission, an independent judicial agency, to guide judges to give more lenient sentences for drug crimes, both retroactively and in the future.

The Obama administration also took executive actions to cut the prison population. Obama has granted pardons and commutations to 1,324 inmates so far — the most of any president since Harry Truman in the late 1940s and early ’50s. And former Attorney General Eric Holder launched the Smart on Crime Initiative that, among other changes, told federal prosecutors to charge and lock up fewer low-level drug offenders.

Combined, the changes led to a first-in-decades reversal of the federal prison population.

State governments have also cut their prison populations over the past few years

The federal government isn’t alone in the recent shift to decarceration. States, which hold a much larger portion of the US prison population, have also enacted reforms in the past few years, typically with a focus on eliminating draconian sentences for low-level drug and property crimes.

The federal prison population makes up just 13 percent of the overall prison system in the US, with states holding the remaining 87 percent of prisoners. So movement at the state level is needed to really undo mass incarceration in America.

And unlike the federal system in which about half of inmates are in for drug crimes, more than half of inmates at the state level are in for violent offenses. That’s why, reformers say, it will be important for states to focus more on cutting sentences and admissions for violent offenses going forward, although there’s still some work to do in reducing punishments for low-level drug and property crimes in many states.

Still, the reforms so far have done a lot to reduce the prison population: During Obama’s time in office, the federal government and states have cut their prison populations by nearly 10 percent. From 2009 to 2015, the state prison population fell from 443 prisoners per 100,000 residents to 402. The federal population, meanwhile, fell from 61 per 100,000 to 55.

But the state incarceration rate began to fall before the federal government’s: The state drop began around 2008, while the federal drop began around 2011. So states have arguably led the charge in decarceration — and they will need to continue doing so if mass incarceration is to truly end.

Studies show mass incarceration plays a small role in fighting crime

Studies have found that there has been no correlation between incarceration rates and crime rates in the past few years. A recent report by the Pew Charitable Trusts, which works to reform the criminal justice system, found, “In the 10 states with the largest imprisonment declines, the crime rate fell an average of 14.4 percent, compared with 8.1 percent in the 10 states with the biggest growth in imprisonment.”

And although the crime rate has fallen by about half in the past couple decades, higher incarceration rates are believed to have played a fairly minor role. A 2015 review of the research by the Brennan Center for Justice, a criminal justice reform group, estimated that more incarceration explained zero to 7 percent of the crime drop since the 1990s. Other researchers estimate it drove 10 to 25 percent of the crime drop since the ’90s. (Other potential contributors to the crime drop include changes in policing strategies and reduced use of cash.)

At the same time, the US remains the world’s leader in incarceration — imprisoning people at a higher rate than any country except the tiny African nation of Seychelles. This comes at a big cost: about $80 billion a year at the local, state, and federal levels. So there’s a big incentive to cut down the prison population, especially since mass incarceration hasn’t, based on the research, significantly impacted crime rates.

Trump could work to undo Obama’s legacy

There’s one threat to all of this progress: President-elect Donald Trump. On the campaign trail, Trump took various “tough on crime” positions, including calling for tougher prison sentences. Trump also nominated Alabama Sen. Jeff Sessions, who was perhaps the leading opponent to criminal justice reform in the Senate, to head the US Department of Justice — suggesting that Trump is serious about his “tough on crime” views.

It remains unclear what exactly Trump could do to reverse the incarceration trends. Federal policy plays a small role in the state prison systems, which make up a great majority of the US prison population, so chances are he couldn’t do much there. But Trump and Sessions could work to reverse the downward trend in the federal prison system, especially since much of the drop in the population there came as a result of executive actions that they could repeal on day one. And that would undo yet another key part of Obama’s legacy.