Chelsea Manning’s courage knows no bounds. This 1.6 metres (5ft 3in) woman with a slight southern accent announced to the world that she was transgender on the Today Show, while incarcerated in an all-male military prison in Kansas.

At that time, Manning had already been a captive of the US government for three years, and had been sentenced to another three decades. She had been interrogated, isolated, and deprived of human contact for months at a time, in conditions that the United Nations called torture.

Even in those darkest moments, she maintained a subtle optimism that never ceased to amaze me.

It was her bravery that landed Manning behind bars in the first place. Her alleged “crime” was shining a light on some of the US government’s worst abuses – giving journalists and human rights advocates a desperately needed window into the devastating effects of US foreign policy and the wars in Iraq and Afghanistan.

When Manning publicly came out as a trans woman, she took on a whole new fight. The Obama administration, despite its stated support for LGBTQ rights, fought Manning at every turn, systematically denying her humanity, and preventing her from accessing medically recommended healthcare related to her gender transition.

Manning refused to give up. With a quiet dignity, she pushed forward. Working with her tireless attorneys she stood up for herself, and in doing so, stood up for all trans people.

Over time, she secured one legal victory after another, gaining access to makeup, some appropriate clothing items, and hormone therapy.

Manning’s passion and willingness speak out for herself and others made her a target for prison officials, who frequently harassed her and threatened her with cruel punishments, including a return to solitary confinement, for minor prison “infractions”.

But Manning would not be silenced. Through her supporters she launched a Twitter account, and later a blog. She wrote for the Guardian not just about her own struggles but about cybersecurity, prison justice, government transparency, and trans liberation. Motivated by her rock-solid conviction and desire to help people, she shared so much of herself with the world, at a time when doing so put her own life and future at risk.

The years dragged on. The Obama administration’s justice department continued to draw out a perverse legal battle to prevent Manning from growing her hair to the length that all other female military prisoners follow. This meant she was forced to get regular haircuts to the male standards not to exceed a few inches, which has caused her constant stress and feelings of dysphoria. Coupled with the ongoing harassment from prison officials, the years of confinement began to take their toll on Manning.

Last July, Manning attempted to take her own life. She tried again in October. If she had succeeded, she would have added to the staggering statistics of suicides among transgender inmates, who are among the most vulnerable members of our community behind bars. But Manning lived, and she was glad for it. Even in those darkest moments, she maintained a subtle optimism that never ceased to amaze me.

When the army announced that they planned to throw Manning back into solitary confinement as a punishment for her suicide attempts, she decided that enough was enough. Manning went on a highly public hunger strike, demanding that the US government treat her with basic dignity and respect, and provide her with medically recommended treatment.

Days later, she won. Military officials provided her with documents assuring that she would receive the healthcare she needed, including gender affirming surgery. It was a historic moment. With each milestone, Manning broke through oppressive barriers and set a precedent that will unquestionably save the lives of countless other trans and gender nonconforming people behind bars.

When I heard the news that Barack Obama had responded to widespread public outcry and commuted the bulk of the remainder of Manning’s sentence, I wept. I thought about the family of trans and queer people who worked tirelessly for years to defend Manning’s life and secure her freedom, while many mainstream LGBTQ rights organisations remained shamefully silent. As the tears streamed down my face, I thought about what it would be like, after all this time, to finally be able to give her a hug.

Chelsea Manning has done so much for all of us. It was an honour to fight for her freedom.