Media playback is unsupported on your device Media caption What next for Chelsea Manning after release?

US soldier Chelsea Manning is celebrating her freedom after being released from military prison.

Manning took to Twitter after her release, photographing her "first steps of freedom" in civilian clothes.

In a brief statement, she said she was focused on the future, which "is far more important than the past".

She served seven years of a 35-year sentence for leaking hundreds of thousands of diplomatic cables and military files to Wikileaks.

Most of her sentence was commuted by then-US President Barack Obama in January.

In a statement issued through the American Civil Liberties Union, which provided her with legal support, Manning said: "After another anxious four months of waiting, the day has finally arrived. I am looking forward to so much!"

She added: "Whatever is ahead of me is far more important than the past. I'm figuring things out right now - which is exciting, awkward, fun, and all new for me."

A US Army spokesperson confirmed that she left Fort Leavenworth military prison in Kansas in the early morning.

Image copyright Twitter Image caption Manning posted her message to a new Instagram account at the same time

The 29-year-old soldier was born Bradley Manning.

A day after she was sentenced to 35 years in prison in 2013, Manning said she had felt female since childhood and wanted to live as a woman called Chelsea.

"For the first time, I can see a future for myself as Chelsea," she said in a statement last week ahead of her release. "I can imagine surviving and living as the person who I am and can finally be in the outside world."

Speaking to the BBC, Manning's friend, the journalist Glenn Greenwald - who was involved in the publication of leaks from Edward Snowden - said she faced a difficult life outside prison.

"She's going to live in a country where the top officials have expressed extreme denunciations of her, condemnations of her, who regard her as a traitor," he said.

"But the reality is that if you look back at what it is that she achieved, she revealed unquestionable war crimes, her disclosures led to reforms around the world."

President Obama's decision to commute her sentence drew criticism from leading Republicans, including Senator John McCain, who called it a "a grave mistake".

'Back to Maryland'

Manning was convicted of 20 charges in connection with the leaks, including espionage. She was acquitted of the most serious charge, aiding the enemy.

She defended the leaking by saying she had wanted to spark a public debate in the US about the role of the military and US foreign policy, but later apologised for "hurting the US", saying she had mistakenly believed she could "change the world for the better".

In January she tweeted that she wanted to move to Maryland after being released, a state where she previously lived.

On Monday she tweeted: "Two more days until the freedom of civilian life ^_^ Now hunting for private #healthcare like millions of Americans =P".

Manning will remain on active army duty while her military court conviction remains under appeal. She will have healthcare benefits but will be unpaid, the army says.

An online campaign set up by her attorney has raised $150,000 (£115,725) to pay for her living expenses for the first year after her release.

If the appeal is denied, she could be dishonourably discharged from the army, US media say.

Image copyright Reuters Image caption Chelsea Manning has been held in an all-male facility

Manning was deployed in Iraq as an intelligence analyst when she leaked hundreds of thousands of files to Wikileaks.

Included in those files was video footage of an Apache helicopter killing 12 civilians in Baghdad in 2007, and many sensitive messages between US diplomats.

Manning twice attempted suicide last year at Fort Leavenworth, a male military prison.

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