PHOENIX — State prison officials have no right to read mail sent by inmates to their attorneys, a federal appeals court ruled Monday.

In a divided decision, the 9th U.S. Circuit Court of Appeals rejected arguments by the state Department of Corrections that they are entitled to read all mail — including legal correspondence — to ensure it does not contain any contraband.

The court said that can be done simply for outgoing mail by scanning the mail before an inmate seals it, and for incoming mail by having a prison guard do the same, in front of the inmate, before handing over the letter.

The judges said security concerns do not require anyone in the prison to actually read the contents to be sure that the matters discussed are truly legal issues.

Monday’s ruling is a legal victory for Scott Nordstrom, on death row after two 1996 Tucson robberies that left six people dead.

But Gregory Sisk, a professor at the University of St. Thomas School of Law, who handled the 9th Circuit appeal with his law students, said nothing in Monday’s ruling affects Nordstrom’s death sentence. Instead, he said, it may help Nordstrom work with his own criminal defense lawyer to overturn those convictions.

Sisk said, though, that the ruling is an important victory for prison inmates and their right to freely communicate with their attorneys.

A spokesman for the Department of Corrections said the agency had no comment.

The case involves a policy for prison employees to review letters from inmates to their attorneys. This is done in front of the inmate before he or she is permitted to seal the envelope to be mailed out.

Attorneys for the state argued this policy ensures inmates can send letters to their lawyers — but only after they have been scanned to ensure that the contents are, in fact, legal matters. But Judge Barry Silverman, writing for the majority, said that is both unnecessary and illegal.

Silverman conceded that courts are not always the best place to second-guess how prisons should be run.

“Nonetheless, prison walls do not form a barrier separating prison inmates from then protections of the Constitution,” he wrote. And Silverman said courts will intervene when a prison regulation or practice offends a fundamental constitutional guarantee.

In this case, Silverman said, the practice violates an inmate’s Sixth Amendment right to legal counsel.

“A criminal defendant’s ability to communicate candidly and confidentially with his lawyer is essential to his defense,” Silverman wrote. “It is obvious to us that a policy or practice permitting prison officials to not just inspect or scan, but to read an inmate’s letters to his counsel his highly likely to inhibit the sort of candid communications that the right to counsel and the attorney-client privilege are meant to protect.”