Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A white Baltimore man — bent on sparking a "global total war on" black people — pleaded guilty to murder and terrorism on Wednesday for a racist slaying in New York City nearly two years ago, prosecutors said.

The trial of James Harris Jackson, 30, was supposed to start on Wednesday in Manhattan Supreme Court, before he admitted to the killing of Timothy Caughman, 66.

He's scheduled to be sentenced on Feb. 13, when he'll get life in prison without the possibility of parole, Manhattan District Attorney Cy Vance said.

It was the first prosecution of a white supremacist on terrorism charges in New York, according to a spokesman for Vance.

"This was more than a murder case," Vance said outside the courtroom. "This was a case of terrorism, just as any Islamic jihadist who has come to New York City and sought to kill New Yorkers in an effort to interrupt and destabilize our way of life."

Caughman was out collecting bottles and cans for recycling when Jackson attacked with no provocation.

"So I'm grateful that he pleaded guilty to all charges, then that way they can just ... take him back and throw the key away," Caughman's friend, Portia Clark, said outside court.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Jackson answered "that's true" when Manhattan Supreme Court Justice Laura Ward asked if he was looking to kill black people and was armed with a sword and two knives.

"This resolution won't bring back Timothy Caughman, a beloved New Yorker who was executed for being black on a Midtown street corner," Vance said in a prepared statement.

"It won't reverse the alarming rise of white nationalism in America. It is, however, the loudest message that a civil society can send to would-be terrorists,"he added, "and I thank our prosecutors and the NYPD detectives whose tireless work enabled us to secure this landmark conviction and send this very loud message today.”

Jackson, a U.S. Army veteran, pleaded guilty to murder in furtherance of terrorism and criminal possession of a weapon.

The killer used a 26-inch "Roman-style sword" to attack Caughman from behind at about 11:15 p.m. ET on March 20, 2017, in midtown Manhattan, prosecutors said.

The mortally wounded Caughman stumbled to the NYPD's Midtown South Precinct station house a block away before dying.

Jackson had traveled to New York, from his home in Baltimore, to commit the crime and gain as much attention as possible for it, officials said.

"After Jackon's arrest on the following day, he told detectives that he came to New York to murder black men because Manhattan is a global media capital," according to a statement by prosecutors. "He stated that he targeted Mr. Caughman because he was black and alone on a dark street."

The killing was intended to be a "political terrorist attack" and a "declaration of global total war on" black people, prosecutors said.

"White nationalism will not be normalized in New York," Vance said. "If you come here to kill New Yorkers in the name of white nationalism, you will be investigated, prosecuted, and incapacitated like the terrorist that you are. You will spend your life in prison without possibility of parole because there is no place in our city or our society for terrorists, 'domestic' or otherwise."

Jackson served in the Army from March 2009 to August 2012 and worked as a military intelligence analyst. He had been deployed in Afghanistan from December 2010 to November 2011, and attained the rank of specialist.

Family friends of Jackson have previously said the violent act was totally out of character — and that he was raised in a tolerant, liberal, middle-class family.

Fri