Image copyright Getty Images Image caption Chelsea Manning is to be released after seven years behind bars

Chelsea Manning has released a statement ahead of her planned release from prison next week.

The transgender US army private, born Bradley Manning, is due to be freed on 17 May, after former President Barack Obama commuted her sentence.

Manning had been scheduled for release in 2045, after receiving a 35-year sentence for her role in leaking diplomatic cables to Wikileaks.

She confirmed the release was going ahead on her Twitter feed on Tuesday.

"Freedom was only a dream, and hard to imagine. Now it's here! You kept me alive <3," Manning wrote, linking to a longer statement which referred to some of the treatment she had received behind bars, including "periods of solitary confinement, and... routinely forced haircuts".

"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."

Image copyright AFP Image caption A supporter waves a placard during San Francisco's 2016 Gay Pride parade

Manning said she would be "forever grateful" to all those who had supported her and President Obama, and now hoped to make "life better for others".

President Obama commuted her sentence in January, with just three days left in office. The move did not satisfy all her supporters, as some felt she should have been pardoned.

A joint statement from her lawyers, Nancy Hollander and Vincent Ward, noted: "Chelsea has already served the longest sentence of any whistleblower in the history of this country. It has been far too long, too severe, too draconian.

"President Obama's act of commutation was the first time the military took care of this soldier who risked so much to disclose information that served the public interest."

What was in the leaked cables?

The US army charged Manning with 22 counts relating to the unauthorised possession and distribution of more than 700,000 secret diplomatic and military documents and videos.

Included in those files was video footage of an Apache helicopter killing 12 civilians in Baghdad in 2007.

Image caption Leaked footage showed a US helicopter pilot killing civilians and journalists

Manning also passed on sensitive messages between US diplomats, intelligence assessments of Guantanamo detainees being held without trial and military records from the wars in Iraq and Afghanistan.

The disclosures were considered an embarrassment to the US, prompting the Obama administration to crack down on government leaks.

At a sentencing hearing, Manning apologised for "hurting the US" and said she had thought she could "change the world for the better".

Manning twice attempted suicide last year at the male military prison where she is being held at Fort Leavenworth, Kansas.

She also went on a hunger strike last year, which she ended after the military agreed to provide her with gender transition treatment.