A homeless man’s desire to fry and eat his dead lover’s penis after cutting it off with a knife came off the rails when he was nabbed by cops.

Jerry Pagan, 32, confessed to the gruesome slaying and mutilation of Richard Reed, 68, at his New York home last month, according to court documents.

And he told cops he was set to join the cannibal club by frying and eating Reed’s penis.

Pagan allegedly arrived at Reed’s home on December 3 and the two men got into an argument. The spat ended with Pagan allegedly bashing in the older man’s brains with a hammer then finishing the job with a pair of scissors.

He told cops: “I stabbed him with a knife and hit him over the head with a hammer and cut off his penis and put it in the sink. I wanted to cut his head off and throw him in the river, but you got to me too early. I was going to fry the penis up and eat it, too.”

When cops arrived the penis was still in the sink with the helpful homeless man telling officers, “go check for yourself.”

Pagan added that the duo had unprotected sex several days before the slaying and he had wanted to get tested but Reed wouldn’t give him the money.

He’s charged with second-degree murder and has pleaded not guilty.