NEW ORLEANS (AP) — A 71-year-old Louisiana prisoner who spent 41 years in solitary confinement and is now dying of cancer was released late Tuesday from prison, his attorneys said.

Late Tuesday, U.S. District Chief Judge Brian Jackson in Baton Rouge denied the state’s motion seeking to block his earlier order overturning Herman Wallace’s 1974 murder conviction in the death of Angola prison guard Brent Miller.

Jackson had also ordered a new trial because women were unconstitutionally excluded from the grand jury that indicted Wallace in the guard’s death. And, he ordered him immediately released.

Wallace and two other inmates convicted in the 23-year-old guard’s slaying came to be known as the “Angola 3.”

Wallace, of New Orleans, was serving a 50-year armed robbery sentence when Miller was fatally stabbed in 1972. Wallace and the two others convicted in Miller’s death were moved to isolation at the Louisiana State Penitentiary in Angola. In 2009, Wallace was moved to “closed-cell restriction” at Hunt Correctional in St. Gabriel and recently was taken to the prison’s hospital unit.

Amnesty International USA last year delivered a petition to Louisiana Gov. Bobby Jindal’s office, containing 65,000 signatures from people around the world who called the men’s solitary confinement inhuman and degrading.

The group’s executive director, Steven W. Hawkins, welcomed the court’s ruling involving Wallace. “Tragically, this step toward justice has come as Herman is dying from cancer with only days or hours left to live,” he said in a statement. “No ruling can erase the cruel, inhuman and degrading prison conditions he endured for more than 41 years.”

Wallace’s attorneys said the freed prisoner left a correctional center in St. Gabriel by ambulance Tuesday evening and was expected to go to LSU Interim Hospital in New Orleans for treatment of advanced terminal liver cancer.

“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,” his legal team said in a statement.

“The record in this case makes clear that Mr. Wallace’s grand jury was improperly chosen in violation of the Fourteenth Amendment’s guarantee of ‘the equal protection of the laws’ … and that the Louisiana courts, when presented with the opportunity to correct this error, failed to do so,” Jackson wrote.

He added, “Our Constitution requires this result even where, as here, it means overturning Mr. Wallace’s conviction nearly forty years after it was entered.”

George Kendall, one of Wallace’s attorneys, told The Associated Press in an earlier telephone interview the decision gives his client “some measure of justice after a lifetime of injustice,” but his response was tempered by the grim outlook for Wallace’s health.

Wallace, whose birthday is Oct. 13, has been diagnosed with terminal liver cancer. Kendall said he “ceased receiving treatment a couple of weeks ago.”

Kendall said the state had filed notice it would appeal Jackson’s ruling. A telephone message left with East Baton Rouge Parish District Attorney Hillar C. Moore III’s office was not immediately returned. The state Department of Public Safety and Corrections referred all questions to Moore’s office.

Kendall said his client has asked that, after his demise, they continue to press the lawsuit challenging Wallace’s “unconstitutional confinement in solitary confinement for four decades.”

“It is Mr. Wallace’s hope that this litigation will help ensure that others, including his lifelong friend and fellow ‘Angola 3’ member, Albert Woodfox, do not continue to suffer such cruel and unusual confinement even after Mr. Wallace is gone,” his legal team said in a written statement.

Kendall said Woodfox won full habeas relief last year but the state has appealed that as well. The case is pending before the 5th U.S. Circuit Court of Appeals.

In 2010, Woodfox was moved to the David Wade Correctional Center in Homer, where he remains in custody.

Woodfox and Wallace have continued to deny involvement in Miller’s killing and say they were targeted because they helped establish a prison chapter of the Black Panther Party at the Angola prison in 1971, set up demonstrations and organized strikes for better conditions in the prison.

The third man, Robert King, was released after 29 years in solitary confinement. King, convicted of killing a fellow inmate in 1973, was released in 2001 after his conviction was reversed and he pleaded guilty to the lesser charge of conspiracy to commit murder.