Four years ago, a jury convicted Robert Neulander, a prominent doctor in central New York, of killing his wife in their suburban home, seemingly ending a complicated case that had riveted the Syracuse area.

It was actually about to get more complicated.

On the day of the verdict, an alternate juror contacted a lawyer for Dr Neulander. That led to the revelation that one of the jurors who had voted to convict him of murder had exchanged 7,000 text messages with family and friends during the three-week trial.

Hundreds of the texts involved aspects of the case, a clear violation of the judge’s standard admonition that jurors not discuss the matter until after the trial was over.

On 22 October, the New York Court of Appeals, the state’s highest court, affirmed an appeals court’s decision last year that the conduct by the juror, Johnna Lorraine, was so bad that the conviction of Dr Neulander should be set aside and that he should get a new trial.

Most shocking courtroom moments: Gunshots, poison and cardiac arrest Show all 8 1 /8 Most shocking courtroom moments: Gunshots, poison and cardiac arrest Most shocking courtroom moments: Gunshots, poison and cardiac arrest War crime general poisons himself Upon hearing that he was guilty of war crimes committed in the Croat-Bosniak War, General Slobodan Praljak drank a small bottle containing a toxic chemical AFP/Getty Most shocking courtroom moments: Gunshots, poison and cardiac arrest Paedophilia is "mega lolz" In a conversation that was later read out in court, former Lost Prophets singer, now convicted paedophile Ian Watkins described his crimes to a fan as "mega lolz". Watkins went on to say "I do not know what everybody was getting so freaked out about." Most shocking courtroom moments: Gunshots, poison and cardiac arrest Man fakes heart attack While acting as his own attorney, Keison Williams feigned a heart attack in an attempt to postpone the case. Noone in the courtroom was convinced by his acting and he went on to be sentenced to 42 years for gun related offences Most shocking courtroom moments: Gunshots, poison and cardiac arrest Judge shot dead While appearing in court on rape charges, defendant Brian Nichols snatched the gun of a courtroom officer and shot dead the judge, a reporter and an officer outside of the courthouse Getty Most shocking courtroom moments: Gunshots, poison and cardiac arrest MJ in PJs In one of the more bizarre events in the 2005 trial of Michael Jackson, where he was charged with child molestation among other counts, Jackson one day appeared late and still dressed in his pyjamas AFP/Getty Most shocking courtroom moments: Gunshots, poison and cardiac arrest Defendant shot dead Gang member Siale Angilau was standing trial in Salt Lake City when he was shot dead by a courtroom officer after he grabbed a pen and moved to attack a rival gang member who was testifying against him Most shocking courtroom moments: Gunshots, poison and cardiac arrest Downey Jr pours heart out In one of the many court appearances of his younger years, Robert Downey Jr said to a judge: "It's like I've got a shotgun in my mouth with my finger on the trigger, and I like the taste of the gun metal." Downey Jr was subsequently jailed on drug charges Getty Most shocking courtroom moments: Gunshots, poison and cardiac arrest "If it doesn't fit, you must acquit" In the closing remarks for the defense in the blockbuster OJ Simpson murder trial, Simpson's lawyer Johnnie Cochran presented a blood-stained glove that had been found at the scene of the crime. The glove did not fit Simpson's hand and the jury was swayed in favour of the defense AFP/Getty

“The extensiveness and egregiousness of the disregard, deception and dissembling occurring here leave no alternative but to reverse” the conviction, the seven-judge court said in its unanimous opinion.

Alexandra Shapiro, Dr Neulander’s lawyer for the appeal, welcomed the ruling. After spending three years in prison, her client was released on bail last year when the appeals court ruled in his favour.

He surrendered his medical license after being convicted.

“Bob Neulander and his family greatly appreciate the Court of Appeals’ decision, which reaffirms that every defendant has the right to an impartial jury and a fair trial,” Ms Shapiro said in a statement.

Ms Lorraine could not be reached for comment. The district attorney has said she will not face criminal charges.

The text messages at issue began the day Ms Lorraine was picked for the jury, court documents show.

“Oh lucky you,” her father wrote to her when she told him the news. “Make sure he’s guilty,” he wrote in another text that day. She did not answer.

“Is he guilty?” a friend asked her later. “Can’t tell,” she replied.

Ms Lorraine received texts during the trial from one friend who called Dr Neulander “scary” and from another expressing surprise that his adult daughter, Jenna Neulander, who was home at the time of her mother’s death and who testified in support of her father, was not a suspect. Authorities did not name her as one.

In another potential violation of the judge’s instructions, Ms Lorraine, a cheerleading coach at the time of the trial, also visited the websites of news organisations that were closely covering the case, according to court documents.

Questioned about all of this later, she lied, doctored some text messages, deleted others and cleared her internet browsing history. She acknowledged violating the judge’s instructions but did not say why she had done so.

She said that none of the texts had affected her deliberations.

Asked for comment about the ruling by the Court of Appeals, Rick Trunfio, the first chief assistant district attorney in Onondaga County where the case was tried, said of Dr Neulander: “We fully intend to retry him for the murder of his wife.”

A new trial is expected to start in the spring.

The case began on 17 September 2012, when emergency services workers and police officers arrived at the Neulanders’ home in the town of DeWitt, New York, to find Leslie Neulander with a severe head injury. She was soon pronounced dead.

Dr Neulander told police that his wife, who he and others said had a history of vertigo, had fallen in the shower and banged her head.

He said her lifeless body was some 60 feet away in her blood-spattered bedroom when officers arrived because he had moved it there in a bid to keep her alive.

Leslie Neulander’s death stunned Syracuse, where she and her husband, an obstetrician-gynecologist who had delivered thousands of babies, were well known for their philanthropy and their devotion to local charities.

They were in the process of separating at the time of her death.

The county medical examiner initially ruled the death an accident, based largely on Dr Neulander’s account. But the amount of blood in the bedroom where she was found left authorities with nagging suspicions about how she had died.

Support free-thinking journalism and attend Independent events

Two years later, Dr Neulander was charged with killing his wife and trying to cover it up.

Prosecutors argued that he had attacked his wife on her bed; continued the attack in the bathroom, where the fatal blow was delivered, most likely against a shower bench; made it look as if her injuries were caused by a fall; and then, after shouting to his daughter to call 911, carried the body back to the bedroom.

Dr Neulander did not testify at his trial. The jury took 18 hours to find him guilty of second-degree murder and evidence tampering. He was sentenced to 20 years to life in prison.

By then, the inquiry into his the juror's behaviour had begun. After a hearing, the trial judge ruled that she had engaged in misconduct but had not been biased and that the verdict should stand.

The decision set off the appeals that resulted in the ruling last month.

One notable aspect of that ruling: the Court of Appeals found that Ms Lorraine had committed “misconduct, deceit and destruction of evidence”, depriving Dr Neulander of his right to a fair trial. But it, too, did not find that she had been biased in reaching a verdict.

William Fitzpatrick, the Onondaga County district attorney, argued in a court filing that the content of some of her texts clearly showed that Ms Lorraine took her duty seriously, even though she was wrong to send them.