An interview with David Carradine recorded just a few months before the actor’s bizarre death — where he talks about the afterlife and a “haunted” closet — was kept secret until this week.

The eerie footage is going to air as a part of a series called “Celebrity Ghost Stories,” premiering Oct. 3 on the cable channel BIO.

On the show, Carradine says that he believes the “ghost” of his wife Annie’s dead husband visited him from the couple’s bedroom closet.

The interview was filmed four months before Carradine’s naked body was discovered hanging in his hotel-room closet in Bangkok June 4, in what appeared to be an autoerotic asphyxiation episode gone wrong. It was kept secret until the series was announced this week.

Rob Sharenow, BIO’s senior VP of programming, said network officials debated whether to release the startling Carradine “Ghost Stories” footage immediately after his death.

“We absolutely had that conversation, but decided not to make a huge deal of it at the time . . . because we didn’t want to seem like we were just rushing into something to exploit [Carradine’s] passing,” he says.

“We wanted to be respectful, first and foremost, and to roll the show out as planned.”

In the segment, Carradine recounts how, after he married Annie (his fifth, and last, wife), strange noises started emanating from their bedroom closet.

“I think [Dana] was hanging out in the closet, and sometimes when I walked into that closet . . . it would be cold in there, unreasonably cold,” Carradine says.

In another segment, Carradine recalls how he went into the “icy cold” closet, where Annie kept some of Dana’s old ties.

“One of the ties was turned around and it had a little logo attached to it . . . that said ‘Grateful Dead,’ and I thought, what does he mean by that?” Carradine says.

“It was obviously a joke, that the dead were grateful . . . it was the only way he could communicate [that] he now felt like everything was settled, the kids were taken care of and I was gonna be there for them,” Carradine says.

“And I will be.”

The show features other celebs — including Joan Rivers, Scott Baio and Carrie Fisher — talking about their brushes with the paranormal.

Sharenow says BIO will heavily promote the Carradine episode, which airs nearly four months to the day after his death.

“We’re absolutely going to feature the Carradine story prominently the week it airs,” he says. “It’s in the first episode, and it was always going to be in the first episode.

“While we don’t want to appear as if we were exploiting his misfortune . . . we don’t want to be shy about talking about it.

“It’s extraordinary — and people are going to notice it.”