The crazed racist accused of murdering an African-American man in Manhattan last year told investigators that he was on a mission to purge the Earth of black people.

“I think we should just preserve the best people and get rid of all the dead weight,” said James Jackson, 30, in the chilling confession tape. “In my opinion blacks are inferior people.”

Later in the interview, he added, “I think they need to be exterminated.”

On March 20, 2017, Jackson said he spotted Timothy Caughman, 66, stooped over a pile of trash, scavenging for cans and bottles, and stabbed him in the back with a sword on West 36th Street near Ninth Avenue.

Caughman, a lifelong New Yorker, fell to the ground, put his hands up and cried out, as Jackson continued to plunge the blade into his chest.

“I thought it would be a lot easier,” said the Army veteran, referring to the difficulty of subduing his victim. “It was a lot harder.”

Jackson discarded the damaged sword in a trash can in Washington Square Park but still had two knives.

After the slaying, Jackson spent hours wandering the city, with his hands in his coat pockets gripping the two knives.

But he failed to strike again.

“It was weird. I didn’t feel great. I didn’t feel horrible either. I thought it [the murder] would send me into a blood rage fury,” recalled Jackson in the videotaped interview played Tuesday at a pretrial hearing Manhattan Supreme Court.

He stalked as many as 15 people and was particularly interested in targeting a black man with a white woman, he said during the interrogation at the Midtown South Detective Squad.

He said he wanted to start a national dialogue about the evils of race mixing, which he called “the main crux” of his white supremacist beliefs.

In an effort to maximize media exposure, he traveled to the Big Apple to commit the crime.

“It would be awesome if we could get the governments of the white countries together,” he said. “Get the ball rolling. Shake people out of their slumber.”

But when Jackson reached Times Square, he became discouraged after seeing so many mixed-race couples.

“It just seemed like I was seeing interracial couples everywhere. It was really demoralizing me,” he said. “This is the new way and we can’t restore what we had 50 years ago.”

Instead of following through on his evil plan, he turned himself in to cops at the Times Square substation a day after the slaying.

Shortly before he was transported to central booking for his arraignment, Jackson allegedly asked Det. Joseph Barbara whether he’d be alone in a cell once he got there.

Barbara said that Jackson told him, “If I’m in with a black man, I’ll definitely kill him.” The exchange was not part of the taped interview.