President Barack Obama on Tuesday commuted most of Chelsea Manning's remaining prison sentence.

Manning, a 29-year-old former Army intelligence analyst, was sentenced to a 35-year prison sentence, which she is serving at Fort Leavenworth, Kansas, for violating the Espionage Act.

Obama commuted all but four months of Manning's remaining 27 year prison term. She is set to be released on May 17.

Groups calling for Obama to grant clemency to Manning, who came out transgender on the first day of her sentence, argued that she has been mistreated by the Army. Manning has tried twice to end her life while in prison, most recently in October.

“She has served more time in prison than any whistleblower in the United States history, and, like many other transgender prisoners, was treated unfairly on multiple occasions based on her gender identity and expression,” said Rebecca Isaacs, executive director of Equality Federation.