Chelsea Manning, the transgender soldier convicted of giving classified government materials to WikiLeaks, is due to be released from a Kansas military prison on Wednesday after serving seven years of her 35-year sentence.

President Barack Obama granted Ms Manning clemency in his final days in office in January. Though she is set to be released from Fort Leavenworth, Ms Manning’s lawyers and the Army have refused to say when and how she will be freed due to potential security concerns.

Ms Manning, who was known as Bradley Manning before transitioning in prison, was convicted in 2013 of 20 counts, including six Espionage Act violations, theft and computer fraud. She was acquitted of the most serious charge of aiding the enemy.

The Crescent, Oklahoma, native tweeted after being granted clemency that she plans to move to Maryland. Neither she nor her attorneys explained why, but she has an aunt who lives there.

Ms Manning, a former intelligence analyst in Iraq, has acknowledged leaking the materials, which included battlefield video. She said she wanted to expose what she considered to be the US military’s disregard of the effects of war on civilians and that she released information that she did not believe would harm the US.

Critics said the leaks laid bare some of the nation’s most-sensitive secrets and endangered information sources, prompting the State Department to help some of those people move to protect their safety. Several ambassadors were recalled, expelled or reassigned because of embarrassing disclosures.

Ms Manning, who was arrested in 2010, filed a transgender rights lawsuit in prison and attempted suicide twice last year, according to her lawyers.

Mr Obama’s decision to commute Ms Manning’s sentence to about seven years, including the time she spent locked up before being convicted, drew strong criticism from members of Congress and others, with Republican House Speaker Paul Ryan calling the move “just outrageous”.

In a statement last week – her first public comments since Mr Obama intervened – Ms Manning thanked that former president and said that letters of support from veterans and fellow transgender people inspired her “to work toward making life better for others”.

“For the first time, I can see a future for myself as Chelsea,” she said. “I can imagine surviving and living as the person who I am and can finally be in the outside world. Freedom used to be something that I dreamed of but never allowed myself to fully imagine.”

Her attorneys have said Ms Manning was subjected to violence in prison and argued the military mistreated her by requiring her to serve her sentence in an all-male prison, restricting her physical and mental health care and not allowing her to keep a feminine haircut.

The Department of Defence has repeatedly declined to discuss Ms Manning’s treatment in prison.

The Army said on Tuesday that Ms Manning would remain on active duty in a special, unpaid status that will legally entitle her to military medical care, along with commissary privileges. An Army spokeswoman, Lieutenant colonel Jennifer Johnson, said Ms Manning will be on “excess leave” while her court-martial conviction is under appellate review.