US soldier Chelsea Manning, serving a 35-year prison term for passing classified files to WikiLeaks, ended her hunger strike on Tuesday after the Army said she would be allowed to receive gender transition surgery, the American Civil Liberties Union said.

The 28-year-old Army private, who was born male but revealed after being convicted of espionage that she identifies as a woman, announced the hunger strike on Friday.

Manning's treatment will begin with the surgery that was recommended by her psychologist in April, the ACLU, which represented Manning, said. Manning is held in Kansas.

No transgender inmate has ever before received gender affirming surgical treatment in prison, the ACLU said.

"I am unendingly relieved that the military is finally doing the right thing. I applaud them for that. This is all that I wanted – for them to let me be me," Manning said in a statement, though she went on to criticise the government for taking "so long."