(CNN) -- After more than 40 years of having his claims of an unjust murder conviction go unanswered, Louisiana inmate Herman Wallace is now a free man.
But it may be a Pyrrhic victory.
Wallace, who spent decades in solitary confinement, is terminally ill with liver cancer.
He was released after a judge vacated his murder conviction and sentence, one of his attorneys told CNN.
State officials had been threatened with contempt if they did not release Wallace immediately.
Wallace, 71, is one of the "Angola 3" -- three inmates who claim they tried to point out injustices at Louisiana State Penitentiary at Angola during the late 1960s and 1970s.
Wallace's sisters, nieces and nephews wanted him moved to hospice care in New Orleans, said one of his attorneys.
"He has claimed there was an unfair trial for 41 years and finally we have that ruling," attorney Nick Trenticosta told CNN on Tuesday night. "For him to pass on from this world with friends and family at his side is extremely important."
The release came hours after U.S. District Chief Judge Brian A. Jackson in Baton Rouge said that women were systematically excluded from the grand jury that indicted Wallace in the 1972 slaying of a guard at Louisiana State Penitentiary.
Jackson declined to address Wallace's other claims, including an allegation that the state knowingly used false testimony and withheld exculpatory evidence at trial.
East Baton Rouge District Attorney Hillar Moore's office subsequently filed an appeal with the Fifth Circuit U.S. Court of Appeals and asked that Wallace not be immediately released.
But, in a strongly worded order, Jackson later Tuesday repeated his demand that Wallace be freed immediately, saying the state has failed to show Wallace would be a flight risk or public danger if released. He threatened them with a contempt judgment.
The judge ruled that prosecutors have 30 days to notify Wallace whether they intend to seek a new indictment in the case.
Wallace's legal team lauded the release of their client.
"Tonight, Herman Wallace has left the walls of Louisiana prisons and will be able to receive the medical care that his advanced liver cancer requires," they said in a statement. "It took the order of a federal judge to address the clear constitutional violations present in Mr. Wallace's 1974 trial and grant him relief. The state of Louisiana has had many opportunities to address this injustice and has repeatedly and utterly failed to do so."
Prison a "cauldron of brutality"
Louisiana State Penitentiary is known as Angola after the land that it is on. The land used to be a plantation that the owners named after the home country of many of the slaves who worked there. The land was eventually bought by the prison system.
There is a museum for the prison, which became known as the "bloodiest prison in the South" because of the number of inmate assaults.
Official histories of Angola mention the abuses it was known for, but considers them a thing of the past.
However, as recently as this year, two death row inmates at Angola testified in court about being subjected to "indescribable" heat where they were held. The testimony was part of a lawsuit against the prison alleging that authorities placed inmates with pre-existing medical conditions at risk, the New Orleans Times Picayune reported.
Citing the case of the "Angola 3," several U.S. congressmen filed a complaint, alleging that inmates are kept in solitary confinement for unreasonable stretches of time.
Wallace was in solitary confinement at Angola until 2009, when he was moved to Hunt Correctional Center. He remained in solitary until his diagnosis, according to Trenticosta.
Trenticosta said Wallace and another inmate at the Angola prison tried "to stop the guard brutality as much as the inmate brutality."
Inmates often were in control of the Angola prison and young men were taken in as sexual slaves by fellow inmates, Trenticosta added. "It was a cauldron of brutality."
Albert Woodfox and Wallace were convicted in the 1972 killing of Angola guard Brent Miller; a third inmate, Robert King, also known as Robert K. Wilkerson, also protested prison conditions. Together, they were known as the "Angola 3."
Woodfox and Wallace claimed they were targeted because of their activism as Black Panthers.
Wallace, who was serving an armed robbery sentence at the time of Miller's death, and Woodfox "were threatening the status quo," Trenticosta said.
King was transferred to Angola just weeks after the guard was killed. Even so, he was investigated as a possible "conspirator" and put into solitary confinement alongside Wallace and Woodfox, according to the documentary "In the Land of the Free." He was never convicted in connection with Miller's death.
King was convicted in 1973 of killing a fellow inmate. His conviction was overturned in 2001, and he was freed.
Diagnosed with cancer this summer
Wallace proclaimed his innocence in Miller's death in appeals.
"Mr. Wallace has fought his unconstitutional conviction for decades and is supported by four alibi witnesses who place him in another part of the prison when the tragic murder occurred," his lawyers said Tuesday.
According to his lawyers, Wallace -- after losing between 40 and 50 pounds -- was found this summer to have terminal liver cancer.
Chemotherapy treatment has not been effective and was suspended, according to Trenticosta, one of the attorneys for Wallace and Woodfox. He said the cancer should have been treated much earlier.
Wallace and Woodfox, who remains in prison with appeals pending in his case, "endured very restrictive conditions, including periods of 23-hour cell confinement," according to Amnesty International USA.
"Tragically, this step toward justice has come as Herman is dying from cancer with only days or hours left to live. No ruling can erase the cruel, inhuman and degrading prison conditions he endured for more than 41 years," Amnesty said.
The human rights organization said it knows of only one other person in the United States who has been held for longer under such conditions.
The American Civil Liberties Union of Louisiana, asked authorities not to appeal the ruling that freed Wallace.
"We hope that they will see reason instead, and allow Herman Wallace the chance to spend his final days outside of the confinement he has endured for more than 40 years," the group said in a statement.
Trenticosta said he last saw Wallace a few weeks ago.
"There is no anger with Mr. Wallace," the lawyer said. "He is the strongest person I have had the great opportunity to represent. He is about positive thinking."
CNN's Chelsea J. Carter contributed to this report.