Connecticut’s top court on Friday ordered a new trial for Kennedy cousin Michael Skakel, who was convicted in the grisly 1975 murder of his 15-year-old Greenwich neighbor, Martha Moxley.

The 4-3 decision by the Connecticut Supreme Court vacated Skakel’s earlier conviction — a decision that infuriated Moxley’s family.

“He’ll be in jail for the rest of his life,’’ Moxley’s brother, John, said of Skakel. “He may not be physically in jail. He may be walking the streets — but he’ll be in hell at some point.”

John and his mother, Dorthy Moxley — who have suffered through the roller-coaster of court proceedings in the high-profile case for four decades — said it was too soon for them to weigh in on what should happen next.

“It’s a disappointment and a surprise. This is not the best day,” Dorthy Moxley told the Greenwich Time.

The court’s majority ruled that Skakel’s colorful trial lawyer, Michael “Mickey” Sherman, did not do a proper job presenting evidence of a possible alibi for him.

The ruling overturned a previous 2016 appellate decision that had reinstated Skakel’s conviction, after a lower court’s order for a new trial.

Skakel was accused of fatally bludgeoning Moxley in their wealthy neighborhood. He was 15 at the time.

The privileged then-teen, the nephew of Ethel Kennedy, who was married to Robert F. Kennedy, was convicted of the murder in 2002.

After being handed a 20-year prison term, he was released on bail following the lower court’s decision to overturn his murder conviction in 2013.

Some of his famous kin, including Robert Kennedy Jr., have long insisted of his innocence.

The well-known name and his family’s wealth generated international attention to his case.

Justice Richard Palmer, who wrote for the majority Friday, said Skakel didn’t get a fair trial because Sherman didn’t get alibi testimony from witness Denis Ossorio.

“Without Ossorio’s testimony, the state was able to attack the petitioner’s [Skakel’s] abili — a complete alibi for the time period during which it is highly likely that the victim was murdered — as part of a Skakel family conspiracy to cover up the petitioner’s involvement in the victim’s murder,” Palmer wrote.

Hubert Santos, an appellate lawyer representing Skakel, had asked the court to re-examine its ruling reinstating the conviction.

Santos maintained that Sherman did not make good decisions in the case, saying that he did not focus on Skakel’s brother, Tommy, as a possible suspect and did not attempt to get in touch with Ossorio, who claimed that Skakel was miles away from the area when Moxley was killed.

Santos also argued that there was no physical evidence or eyewitnesses connecting Skakel to Moxley’s murder.

Sherman has defended his work, and state prosecutors have argued that he did an adequate job.

With Post wires