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.
Exercise was permitted three times a week and there were restrictions on “personal property, reading materials, access to legal resources, work, and visitation rights”.
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 alawnmower blade.
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”.
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
Woodfox is currently being 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.
Woodfox, Wallace and King consistently maintained they were imprisoned for crimes they did not commit, with convictions only obtained after mistrials.
He said he remained strong but it was “scary” to see how others crumbled through lack of human contact.
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”.