WikiLeaks founder Julian Assange has hailed Chelsea Manning a hero and said her pending release from prison is an “epic victory”.

The former US intelligence analyst is due to leave a military jail on Wednesday after serving seven years of a 35-year sentence for leaking hundreds of thousands of classified government documents.

Former president Barack Obama commuted the transgender soldier’s sentence in his final days in the White House, outraging Republicans including Donald Trump, who has described her as an “ungrateful traitor”.

Manning’s Welsh-Irish family said the sentence had been a “travesty of justice”.

WikiLeaks founder Julian Assange (Dominic Lipinski/PA)WikiLeaks founder Julian Assange (Dominic Lipinski/PA)

Mr Assange called her release “an epic victory which I and many others have long sought. Chelsea Manning is a hero who has inspired many. I can’t wait to finally meet her”.

In a statement, Manning said she hopes to use the lessons she received in prison to help others.

She added: “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.”

Manning was arrested in 2010 and convicted in 2013 of six violations of the US espionage act for leaking 700,000 secret military and State Department documents.

The trove, which included classified battlefield videos, was one of the biggest breaches of intelligence in US history.

She acknowledged leaking the files while working in Iraq, but protested that she had acted to raise awareness of the impact of US military action on innocent civilians.

Then known as Private Bradley Manning, she later underwent gender transition in jail. She will be released from a correctional facility at Fort Leavenworth, a US Army disciplinary barracks in Kansas.

Manning, whose father is American, was born in Oklahoma but moved to Haverfordwest in Pembrokeshire, West Wales, just before she turned 14 in 2001 following her parents’ divorce.

She attended Tasker Milward comprehensive school and still has family and friends in the area.

In a statement her family said Manning had endured “seven years’ loss of liberty for her whistleblowing actions while those whose wrongdoing she exposed have gone unpunished”.

“The shocking and abusive ill-treatment Chelsea was subjected to in Kuwait and (US Marine base) Quantico before the trial should never have happened and the 35-year sentence handed down by the military court was a travesty of justice.

“We are naturally very relieved that this ordeal will soon be over for Chelsea and that she will be able to take up her place in society again.

“Whatever she decides to do, we are sure she will make a significant and positive contribution.”