The Libyan militia leader charged in connection with the 2012 attacks in Benghazi that killed the United States ambassador and three others was brought to Washington early Saturday, where he entered a not guilty plea at the federal courthouse, formally opening one of the most complicated terrorism cases the Justice Department has mounted in recent years.

The suspect, Ahmed Abu Khattala, was flown to Washington by helicopter from a Navy warship that had steamed across the Atlantic Ocean from the Mediterranean Sea after he was captured by American commandos at a seaside villa near Benghazi two weeks ago.

Moving Mr. Abu Khattala to Washington to face charges was a significant step for the Obama administration, which had been criticized for moving too slowly to apprehend suspects. Both Democrats and Republicans had injected partisan statements into the debate over proper embassy security and accurate assessments of militant threats. Some also questioned the decision to prosecute Mr. Abu Khattala in civilian court, rather than through a military tribunal at Guantánamo Bay, Cuba.

Mr. Abu Khattala’s appearance at the United States District Court here spurred a scene that rarely unfolds at the court. In the hours before the hearing, federal marshals wearing bulletproof vests and holding machine guns roamed the streets outside the courthouse, about a mile from the White House, while marked and unmarked government vehicles patrolled nearby.

At the hearing before Magistrate Judge John M. Facciola, the first two rows of the courtroom were filled with senior federal prosecutors and plainclothes F.B.I. agents. Among the prosecutors was the United States attorney for the District of Columbia, Ronald C. Machen Jr., who rarely attends trials, let alone arraignments.

The hearing lasted about 10 minutes and was uneventful. Instead of the jail uniforms defendants typically wear, Mr. Abu Khattala wore a long-sleeved, black shirt with a hood and black pants. He listened through a headset to an interpreter who translated the proceeding into Arabic.

Mr. Abu Khattala said only two words at the hearing. Speaking in Arabic, he answered “yes” when asked whether he swore to tell the truth and “no” when asked whether he had any difficulty understanding what was being said.

Prosecutors have indicted him on one count of conspiring to provide material support and resources to terrorists that resulted in a death; a conviction can carry up to a life sentence. But that single count is a placeholder for more charges the government is expected to file in the coming weeks, and it allows the government to hold Mr. Abu Khattala now without revealing its entire case against him.

A public defender, Michelle Peterson, entered the not guilty plea for Mr. Abu Khattala.

Several minutes after the hearing, marshals blocked off the streets around the courthouse. A motorcade of black sport utility vehicles and a police car with its siren blaring sped from the courthouse to the jail where Mr. Abu Khattala will be held.

The judge scheduled a detention hearing for Wednesday and a status hearing for July 8.

A senior American law enforcement official said that Mr. Abu Khattala had cooperated with federal interrogators during questioning aboard the Navy warship over the past two weeks but that he was probably still withholding some important information. Before leaving the ship, Mr. Abu Khattala was given a Miranda warning informing him that he had the right to remain silent and be represented by a lawyer, the law enforcement official said.

“What he’s provided so far has been useful and helpful, but it’s not complete,” the official said.

Law enforcement officials said that upon reaching Washington, Mr. Abu Khattala was given the choice of continuing to be interrogated or being presented to the magistrate. He chose to appear before the judge. The officials said they believe that he wanted to consult a lawyer and decide what else he might want to say.

Current and former senior American law enforcement officials briefed on the government’s investigation of Mr. Abu Khattala said the next phase of the case — proving the charges against him in federal court — would be particularly challenging because the attacks occurred in a country that is not friendly to the United States.

“Proving this case won’t be a walk in the park,” said Neil MacBride, the United States attorney for the Eastern District of Virginia from 2009 to 2013.

The case, he said, is not a “traditional deal where cops show up, put up yellow tape, and spend two hours lifting fingerprints, picking up shell casings, interviewing the victim.”

F.B.I. investigators were not able to visit the crime scenes in Benghazi to collect evidence until several weeks after the attacks because of security concerns there. The case also relies on Libyan witnesses who will most likely have to be flown to the United States to testify and who may not hold up well to being cross-examined.

Yet law enforcement officials expressed confidence in the work. “We have plenty of evidence to convict this guy,” one official said.

The hostile environment in Libya and the difficulty of tracking down and interviewing all the witnesses were among the reasons the investigation took so long, even amid reports that after the attacks, Mr. Abu Khattala was meeting with reporters for drinks to discuss the violence.

While American intelligence agencies were able to intercept electronic conversations that could help the investigation, their classified nature makes them problematic to use in a public criminal trial, according to the officials.

The case is expected to be presented mainly on eyewitness accounts and video from the scene. Hundreds of hours of video from security cameras and other sources were analyzed to produce a narrative of the time leading up to the attacks, the siege of the mission and the C.I.A. annex, and the aftermath, one official said.

“The Department of Justice bats nearly 1,000 percent with these types of extraterritorial cases, but that’s because they put in so much diligence on the front end of the investigations,” said Mr. MacBride.