Radio host Alex Jones relied on a “raving lunatic” conspiracy theorist to promote his on-air rhetoric claiming the Sandy Hook massacre was a hoax, according to court records.

Wolfgang Halbig, 77, bombarded the InfoWars host with at least 4,000 emails — which Jones relied on to conclude that the 2012 school shooting may have been staged by the government to get more gun-control laws.

“It’s a lot, yeah,” Jones admitted of the messages.

The link emerged in Jones’ response to a lawsuit filed against him by the family of 6-year-old Jessie Lewis who was among the 20 children slain at Sandy Hook.

The family’s attorney, Mark Bankston, pointed out Jones regularly said the source for his information was “going off what Mr. Halbig said.”

“Looking at those emails … you wouldn’t agree with me that that man is a raving lunatic?” the lawyer asked bluntly during the deposition.

“He seemed very credible and put together earlier on,” Jones insisted of the man who discussed the “supposed tragedy” on InfoWars.

However, Jones — who also admitted going through a personal “psychosis” at the time — admitted concerns of his own.

“He seemed to get agitated about four years ago, three years ago,” he said.

Halbig admitted to the Orlando Sentinel that he has spent at least $43,000 with at least two dozen trips to Newton, Conn., for “research” — demanding public records including photos of the children’s bodies.

Halbig stuck by his controversial views about whether children actually died in the massacre in an interview released on Thursday.

“I can’t tell whether they died or they did not,” Halbig told the Orlando Sentinel.

“But for six years I have made public records requests to prove whether this happened or not. And they have refused to give me those documents.

“I wanted, for once and for all, to know whether Sandy Hook happened.”

He maintained that he is a victim.

“Why am I being attacked for Sandy Hook?” Halbig whined. “I’m trying to get answers.

“And if you prove me wrong, then I will apologize profusely and I will check myself into a mental hospital.”

However, he admits his family — a school teacher wife and two adult sons — beg him to drop his obsession.

“‘Just leave it alone.’ That’s what they told me,” he admitted.

Nelba Márquez-Greene, whose daughter Ana also died at Sandy Hook, recently called Halbig “a certified lunatic” on Twitter.

“He’s been asking for pics and dash cam crap forever,” she wrote. “These aren’t bots. These are real people. I’m like- for real you think we faked this? You think first responders did? What a depraved mind. Depraved.”

The deposition and other court records are part of a defamation lawsuit brought against Jones in Texas by Scarlett Lewis, whose son Jessie, 6, was killed at Sandy Hook while helping other children escape.

It is among four lawsuits families of nine victims of the school shooting have filed against Jones and Infowars.