Massachusetts' highest court has said that problems with the storage of DNA and other kinds of crime evidence could threaten the integrity of the state's criminal justice system by making it harder to overturn wrongful convictions.

In a decision on Tuesday, the Supreme Judicial Court ruled on several similar cases in which there was a tussle between state court clerks and local police departments over who would store and preserve such evidence. In its decision, the court said that Massachusetts needs a state of the art facility for evidence storage staffed by trained professionals.

The SJC ruling largely affirmed three separate lower court decisions that sent evidence to be stored at the Everett and Lowell police departments. It did so because it agreed with the state court clerks' argument that they had neither adequate safe storage or trained staff to store some evidence, such as firearms and live ammunition.

But the court said in its ruling that the clerk's office would have to meet its statutory responsibility to store evidence over the long term, and that the decision "does not resolve the vexing issue of the safe storage and preservation of ... evidence in criminal trials" that is mandated by the state's DNA testing law.

In 2012 Massachusetts became the 49th state to enact a such a law; it requires the preservation of DNA and other evidence for as long as a person is in custody.

The SJC took the opportunity in its decision to underscore the importance of proper evidence storage, and urged that the Baker administration, the state legislature and the judiciary all work together to solve the problem.

Lisa Kavanaugh, director of the Innocence Program that’s part of the public defender system, told WGBH News that the SJC decision recognizes the need to avert what she calls "the worst kind of tragedy."

"We have had clients who are unable to do DNA testing that could well prove their innocence because they're unable to find the physical evidence to test," Kavanaugh said.

In its decision, the SJC says there are fundamental obstacles to following the DNA testing law.

“Unfortunately, most of the court houses in this Commonwealth lack the facilities and trained staff to meet their statutory responsibility. Clerks' offices do the best they can with the resources and facilities provided," the decision reads.

The SJC goes on to say the problem is a "grave challenge" to all three branches of government “that raises questions about the fair administration of justice,” and that “no branch is capable of solving it alone.”

The court said that while a new statewide facility is needed, it noted that that the SJC “cannot order the legislature to appropriate funds for a state of the art storage facility, nor can we order the executive branch to build one.”

Kavanaugh sits on a working group that ensures the state meets the requirements of the 2012 DNA testing law, and she said while there is still disagreement at times over where evidence should be stored, there is broad consensus that evidence storage must be improved.

“I absolutely think that all parties including the prosecutors, including the state police crime lab, ultimately want this evidence maintained in a way that allows for future testing,” Kavanaugh said.

The SJC concluded its ruling by observing, “At issue is not merely the integrity of exhibits. It is the integrity of our criminal justice system, the bedrock of which is fairness, that is at stake.