An Orange County Superior Court judge has dismissed child-molestation charges against a 98-year-old Laguna Woods man after finding that he sufferers from severe dementia and may have acted unintentionally.

Kenneth Leroy Collins was 96 when arrested in March 2016 and charged with molesting two girls, then ages 10 and 11.

Described by family members as a frail World War II veteran, he spent about a week in the Theo Lacy jail and then about a month in a medical ward before an anonymous person posted his $1 million bail, his family said.

Although officials don’t keep such records, he was clearly one of the oldest inmates ever held in an Orange County jail. The Sheriff’s Department declined to reveal specifics on his housing at the time, but did say it was appropriate and well monitored.

Prosecutors had accused him of touching the girls over their clothing, masturbating and taking off his adult diapers to expose himself when they would visit his Leisure World home.

But in his Thursday ruling, Judge Gregory Jones dismissed all charges after reviewing a psychological evaluation and medical records. The judge noted that Collins, who uses a wheelchair, suffers from “severe dementia and kidney disease.”

“Given his age at the time of the commission of actual acts, the court has serious questions as to whether or not he had the requisite specific intent,” the judge said in court records.

Collins’ wife and his sister-in-law have maintained that Collins is not of proper mind and didn’t have the strength or opportunity to molest anyone.

“We’re so relieved this nightmare is over,” said his wife, Yvonne Collins, 71. “I thank the dear Lord that now when Ken dies, he’ll leave this earth as a WWII hero where he can be saluted, not as a convicted child molester.”

Orange County Deputy District Attorney Heidi Garrel, who prosecuted the case, said on Friday that the office believes it had a “viable case” but does not plan to refile charges.

“I respect the court’s the decision, but we firmly support our victims,” she said. “The defendant admitted the crime, and we were prepared to proceed.”

Yvonne Collins said she belies her husband was confused and may have given a false confession to deputies before his arrest.

Yvonne Collins, who married her husband eight years ago, said he would sometimes walk out of the bathroom as his adult diapers were falling and was not aware that he was exposing himself.

She said Collins didn’t understand why he was in jail. She said she was appalled to find out he was handcuff to his wheelchair while in custody.

“Ken doesn’t know what he did from day one, because he didn’t do anything,” she said. “What (law enforcement) did to him was terrible.”

Authorities said there are no statistics available on inmates over 65 in Orange County, but Collins at the time was one of 305 prisoners older than 56.

After a 40-year career as an engineer at Lockheed Martin, Collins moved to Laguna Woods from Pasadena in 1989. He was a widower with two grown children when he married Yvonne Collins.

A Laguna Woods Historical Society document describes Collins as a U.S. Navy veteran during World War II. He served as an aviation storekeeper aboard the USS Essex, an aircraft carrier in the Pacific Theater, from 1943 to 1945 and was involved in 67 combat missions.

“It’s been a very tough two years,” said Collins’ sister-in-law, Frances Corado. “We’re just glad it’s over.”