PORTLAND, Maine — The Maine Supreme Judicial Court on Thursday unanimously reversed the convictions of two men incarcerated after being convicted of sex crimes because jurors in the separate cases were told the defendants refused to cooperate with investigators.

The court sent the cases back to the lower courts.

Spencer T. Glover , 32, of Bryant Pond was sentenced in July 2012 to 10 years with all but six years suspended and three years of probation after being convicted of Class B gross sexual assault at the Oxford County Courthouse in Paris.

He refused to voluntarily submit to a DNA test, which, under the Fourth Amendment of the U.S. Constitution, he had a right to do, the justices ruled. The prosecution should not have suggested to jurors that the refusal implied that he was guilty, the court found.

In the other case, Jason M. Lovejoy, 41, of North Carolina was sentenced in August 2012 at the Cumberland County Courthouse in Portland to 20 years with all but 16 suspended and 10 years of probation after his conviction on two counts of Class A gross sexual assault.

Justices found that Lovejoy invoked his right against self-incrimination, protected by the Fifth Amendment, when he hung up on investigators and refused to return their phone calls. The prosecutor’s statements to the jury about his silence denied Lovejoy a fair trial, the court found.

Both men are seeking to be released on bail, their attorneys said Friday.

James Billings of Augusta represented Glover when the appeal was argued before the state’s high court in December. Jeremy Pratt of Camden represented Lovejoy in his appeal, heard in September. Neither attorney represented the defendants at their trials.

Efforts to reach prosecutors in the cases to determine if new trials would be sought were unsuccessful Friday.

Glover was accused of sexaully assaulting a sleeping friend at his home in January 2011 after a night of drinking, according to a previously published report. The woman testified that she woke up during the attack. Glover took the stand and said the sex was consensual.

“The Fourth Amendment protects an individual’s right ‘to be let alone,’ which is wholly independent from procedural concerns relating to the ascertainment of truth,” Justice Warren Silver wrote for the court in an 11-page opinion. “Invocation to this right has no legitimate bearing on the likelihood that a defendant is guilty of a criminal offense.”

Lovejoy was charged after a 15-year-old female relative in 2010 told Portland police he had sexually abused her when when she was between the ages of 5 and 8. The first trial in February 2012 ended in a mistrial. Lovejoy was convicted in a second trial the following month.

“We cannot confirm a conviction that so evidently depended on the jury’s determinations of credibility when the prosecution offered evidence and argument that the defendant’s decision not to speak to the police constituted evidence of guilt,” Chief Justice Leigh I. Saufley wrote in the 20-page opinion that reversed Lovejoy’s convictions.

Zachary Heiden, legal director of the American Civil Liberties Union of Maine Foundation, praised the decisions.

“Everyone has a right to remain silent and a right to privacy, and exercising those rights is not evidence of wrongdoing,” he said Friday. “The outcomes of these cases underscore just how serious it is when prosecutors choose to ignore the Constitution. The Fourth and Fifth Amendments were put in place for a reason, and prosecutors can’t just pick and choose when they apply.”