An unhinged man who allegedly beat his 64-year-old roommate to death in a Lower East Side apartment last month told police he did it during a dispute over air conditioning, according to newly released court papers.

“They wouldn’t turn on the air conditioning unit, and it had black mold in it, so I snapped,” admitted Truman Dulaney, 46, referring to the couple who had let him move in after they met on a CIA Facebook page.

Dulaney allegedly bludgeoned Doru Vaduvescu with a wooden club and the butt of a knife then locked him inside his bedroom with his wife, Mimi, for more than 36 hours. He allegedly told police that he stole Vaduvescu’s debit card and demanded the PIN so he could buy liquor and cigarettes.

Mimi eventually sneaked out a window Aug. 22 to get help. Her husband died hours later from cardiac arrest at the Bellevue Hospital Center.

“When I came back she’d gotten out like a godd–n monkey,” he later told cops of Mimi’s escape.

Dulaney said he met the couple online, and they flew him from Mississippi to New York to live with them.

Police executed a search warrant on the Henry Street apartment and recovered a book entitled “CIA Black Book of Boobytraps” and an envelope emblazoned with the phrase “licensed to kill.”

Dulaney pleaded not guilty Monday to charges of second-degree murder, assault, kidnapping and robbery in Manhattan Supreme Court.