A white supremacist who killed a black man with a sword wanted to ignite a worldwide race war, a prosecutor told a judge who sentenced the man Wednesday to life in prison without parole.

Manhattan District Attorney Cyrus Vance read excerpts from James Jackson's hate-filled manifesto as he decried the "horror of his actions" when he fatally stabbed 66-year-old Timothy Caughman in March 2017 after stalking a number of black men in New York City.

"James Jackson is a white supremacist and a terrorist," Vance said of the Baltimore man and veteran who served in Afghanistan.

Given a chance to speak, Jackson, who is white, said he wanted to apologize for "this horrible and unnecessary tragedy."

"It never should have happened," he added. "And if I could to it all over again, this never would have happened, for sure."

State Supreme Court Justice Laura Ward kept her remarks brief.

"You killed a man solely because he was black," she said. "And there is no excuse for your actions."

Richard Peek, a cousin of the victim who spoke for the family, read aloud an "open letter to a murderer" in court, saying "one cruel man's intolerance turned many people's worlds upside-down."

Caughman, who was remembered as a gentleman and a good neighbor, was attacked while collecting bottles for recycling.

Jackson, 30, told police he traveled from Baltimore to carry out the attack because New York is the media capital of the world. He said the slaying was intended to be practice for further assaults on black people.

Vance said Jackson's manifesto was on a digital storage drive recovered after his arrest. The prosecutor said he did not want to make the entire document public to avoid helping to spread its hateful content. But he wanted to put some of it on the record for the first time.

"The racial world war starts today," Vance said, reading from the manifesto.

He said Jackson called for military and biological warfare aimed at the "extermination" of black people and urged authorities in the United Kingdom, China and Russia to get involved.

Vance lamented that American law enforcement has been slow to acknowledge the problem of white supremacism and has sometimes minimized it.

"We have too often treated these crimes as something less than other kinds of terrorism, and in so doing we have risked normalizing this type of behavior," he said.

He asked the judge to "send a message to other would-be terrorists."

Jackson's attorney, Frederick Sosinsky, said his client had marched with family members to protest racial injustice, had served honorably alongside blacks in the military, and had never committed a crime before "the worst day of his life."

"His lost soul and broken spirit permitted him to act as he'd never acted before," Sosinsky said.

Outside court, Vance said Jackson's worldwide plan was "diabolical and cruel."

"He came to New York in the hope of inciting a race war that would pit New Yorkers against New Yorkers and ultimately blacks and whites against each other all over the world," he said.