Image copyright A3 Coalition Image caption The judge ordered Albert Woodfox's unconditional release

A judge in the US state of Louisiana has ordered the release of an inmate who has been in solitary confinement for more than 40 years.

Judge James Brady also banned prosecutors from trying Albert Woodfox, 68, for a third time.

Following Brady's orders, Woodfox could be released from jail within days.

He has been in solitary confinement since April 1972, after he was blamed for the death of a guard during a prison riot.

Woodfox was tried twice for the guard's death, but both convictions were later overturned. He denies all the charges.

He was confined for 23 hours a day, with an hour outside his cell to "walk alone along the tier on which his cell is located", according to court documents from a case challenging his prison conditions.

Exercise was permitted three times a week and there were restrictions on "personal property, reading materials, access to legal resources, work, and visitation rights".

Media playback is unsupported on your device Media caption What's it like to spend decades in solitary confinement?

Originally convicted and imprisoned for armed robbery, he was found guilty of murder after the riot in which prison officer Brent Miller was stabbed to death with a lawnmower blade.

On Monday, Judge Brady ordered the unconditional release of Woodfox and said a third trial could not be fair.

But a spokesman for the Louisiana attorney general said prosecutors would appeal "to make sure this murderer stays in prison and remains fully accountable for his actions".

Solitary confinement in the US

Image copyright Getty Images

80,000 prisoners estimated to be in solitary confinement in the US

Held in 44 states, 25,000 in super-maximum security ("supermax") jails

Conditions vary, but can include up to 23 hours a day confined alone

Psychologists warn of negative reactions, such as isolation panic

UN torture rapporteur wants global ban in all but exceptional circumstances

Proponents say needed to protect other prisoners and staff

Sources: ACLU, Bureau of Justice Statistics. Solitarywatch.com, Louisiana Prison Watch

How do you survive solitary confinement?

Woodfox is currently being held at a detention centre where he was placed in isolation ahead of his trial.

He is one of three men who were held in solitary confinement at the maximum security Louisiana State Penitentiary and known as the "Angola Three", as the prison lies next to a former slave plantation called Angola.

The other two men, Robert King and Herman Wallace, were released in 2001 and 2013 respectively. Wallace, also convicted over Mr Miller's murder, died soon after his release pending a new trial. King's conviction was overturned.

King and Wallace were also initially imprisoned for armed robbery.

Woodfox and Wallace were involved with the Black Panthers, a militant black rights movement formed in 1966 for self-defence against police brutality and racism, which later embraced "revolutionary" struggle as a way of achieving black liberation.

Image copyright A3 Coalition Image caption Campaigners have long called for all three men to be released

Woodfox, Wallace and King consistently maintained they were imprisoned for crimes they did not commit, with convictions only obtained after mistrials.

King, who spent 29 years in solitary confinement, described his experience to the BBC in an interview three years ago.

He said he remained strong but it was "scary" to see how others crumbled through lack of human contact.

The three men have been the focus of a long-running international campaign.

Tory Pegram of the International Coalition to Free the Angola Three, said she had spoken to Woodfox late on Monday and he was "excited and nervous".

Jasmine Heiss, a campaigner with Amnesty International USA, said the decision to release Woodfox was "a momentous step toward justice".