There is no one who has suffered more under the US government’s crackdown on leakers and whistleblowers than Chelsea Manning. But now, after President Obama commuted her unjust 35-year jail sentence on Tuesday, she will, amazingly, soon be able to walk free.

Manning, who provided journalists a historic treasure trove of documents and the public an unparalleled window into world diplomacy, will no longer have to spend the rest of her life behind bars. She will be released from prison on 17 May instead of the unconscionable 2045. It’s a cause for celebration, but also a time for reflection – not just about what she has gone through but what her case represents.

At the time of her revelations, she was the most important whistleblower since Daniel Ellsberg. Upon hearing the news today, Ellsberg said this: “Once in a while, someone does what they ought to do. Some go to prison for it, for seven years; some accept exile for life. But sometimes even a president does it. And today, it was Obama.”

Many publications have tried to list the many stories her revelations have contributed to over the years, but almost all have fallen short. The State and Defense documents that were leaked by Manning – originally to Wikileaks and published by the Guardian, New York Times and others – are to this day cited regularly in the nation’s largest newspapers. They provided historians and the public a view inside the US government’s machinations that we’ve never seen before. They even helped end the Iraq war.

In response, the government quite literally tried to destroy her. Although the government admitted that no one was harmed because of her disclosures, Chelsea suffered beyond what is imaginable for most people.

She was held incommunicado during pre-trial confinement, so that the American people could not hear her voice and the explanation for what she did. She was then, according to the UN special rapporteur on torture, treated in a “cruel, inhumane and degrading way” before her trial by the US military.

After that, she was given a heartbreakingly long 35-year sentence, longer than most actual spies, and, for that matter, rapists and murderers. She faced the prospect of spending the rest of her life behind bars, where she was continually and harshly punished for trivial violations. Recently, she had been put in solitary confinement – a macabre punishment for attempting suicide.

No matter your political leanings or views on the role of leaks in our democracy, the treatment Chelsea has suffered over the last 10 years is shameful. With a stroke of his pen, President Obama not only did the right thing, but quite literally may have saved Chelsea’s life.

That said, the commutation of Chelsea Manning’s sentence cannot be looked at in a vacuum. President Obama, while commendably showing her mercy, also oversaw a justice department that prosecuted more whistleblowers than all other administrations combined, while casting an unmistakable chill over investigative reporting and press freedom.

In the coming days many will ask why President Obama chose to commute Chelsea’s sentence. Was he looking to the history books, knowing he would go down as the president who went after whistleblowers?

Was he secretly appalled by the treatment Manning received in both pre-trial confinement and then later, after she was convicted? (He did, after all, condemn solitary confinement in the Washington Post last year.) Was he worried about what type of retribution the Trump administration would take once in office? Or did he just realize that Manning’s sentence was orders of magnitude higher than any other leaker in history and fundamentally unjust?

Only the president knows why. But we do know this: he made the right decision, one that he didn’t have to. It won’t erase his tragic legacy of cracking down on leakers and journalists’ sources, but he should be commended for it. So: thanks, Obama. Seriously.