A Mali national accused in the killing of an American diplomat more than a decade ago was arraigned Thursday in federal court in Brooklyn after the FBI secretly brought him to the United States to face trial.

A federal indictment alleges that Alhassane Ould Mohamed, 43, fatally shot William Bultemeier in Niamey, Niger, on Dec. 23, 2000. A Marine who was with Bultemeier was wounded in the incident.

Mohamed, who faces attempted murder and murder charges, pleaded not guilty. He remains in federal custody.

Investigators said that Mohamed and an accomplice, armed with a pistol and AK-47 assault rifle, ambushed Bultemeier and Christopher McNeely, then a Marine Corps staff sergeant, in the early hours of Dec. 23 after the pair left a restaurant.

As Bultemeier entered his vehicle, which was marked with diplomatic plates, Mohamed demanded his keys and then shot Bultemeier with the pistol, authorities said.

A photo of William Bultemeier who was killed by Alhassane Ould Mohamed, in Niamey, Niger on Dec. 23, 2000. (U.S. Attorney’s Office in Brooklyn/U.S. Attorney’s Office in Brooklyn)

When McNeely ran to Bultemeier’s aid, Mohamed’s accomplice opened fire with the AK-47, hitting both Americans, prosecutors said.

The attackers drove away in Bultemeier’s vehicle. Two days later, Mohamed was arrested in Mali. He escaped captivity in 2002.

In 2010, Mohamed was arrested in Mali in the slaying of four Saudi nationals in northern Niger, according to the FBI. He was sent back to Niger, where he was convicted of the killings and sentenced to 20 years in prison, but in 2013, he escaped once more.

French forces captured him in Mali last year, and U.S. officials filed an extradition request.

Investigators don’t think the shooting of the Americans in Niger was politically motivated.

The case lingered for years in the U.S. attorney’s office in Washington., with prosecutors failing to advance the investigation, law enforcement officials said. At one point, an assistant U.S. attorney in Washington wrote a memo outlining why Mohamed could not be prosecuted.

In their investigation, FBI agents traveled overseas to locate witnesses to the killing.

In early 2012, the U.S. attorney’s office in Brooklyn, which has handled many overseas crimes and high-profile terrorism ­cases, agreed to handle the investigation. Mohamed was indicted in September 2013.

A spokesman for the Justice Department declined to comment on why the case was transferred to federal prosecutors in New York.

McNeely could not be reached for comment. He retired from the Marine Corps as a master sergeant.

Bultemeier, who served as the defense attache system operations coordinator, had been scheduled to return home two days after the shooting.