Murder charges were dropped against an Alabama man accused of killing his wife 30 years ago — after the couple’s friend confessed to the slaying just hours before the trial got underway, officials said.

The stunning announcement came Monday as 55-year-old Carl Harris was set to face trial for the 1990 murder of Tracy Harris, who was found dead in the Choctawhatchee River with signs of strangulation.

Ozark Police said 54-year-old Jeff Beasley, a former friend of the couple, admitted to the murder on Sunday — providing very specific details about the case.

“The new evidence was information that had never been shared before,” Ozark Police Department Chief Marlos Walker told reporters, according to ABC News. “The suspect gave details about the crime that only the killer would know.”

Walker didn’t provide further details about the bombshell confession but said authorities interviewed Beasley’s ex-wife, who offered information that led them to him, the Dothan Eagle said.

Harris was arrested in 2016 after authorities reopened the investigation. He denied the charges, saying they were built on circumstantial evidence and faulty witness testimony.

The charges were dropped on Harris’ 55th birthday.

“As district attorney, it is my job to not only seek justice, but to be fair to everyone involved,” Dale County District Attorney Kirke Adams said at a press conference. “This has been an incredible series of events and, undoubtedly, led from above.”

The Harris’ daughter, Carolyn Aznavour, said it was relief that her father was cleared in her mother’s murder.

“It was all in the Lord’s timing,” said Aznavour.

With Post wires