WASHINGTON — A Libyan man was found guilty on Thursday on two terrorism-related charges arising from the attack on a United States diplomatic compound in Benghazi in 2012 that killed two Americans, including the ambassador to Libya, and became a political flash point.

But the jury in Washington remained deadlocked on 15 other charges against the man, Mustafa al-Imam, and the Federal District Court judge overseeing the trial ordered jurors to keep deliberating on the remaining counts. Those included aiding and abetting several murders and aiding the follow-up attack, hours later, on a nearby C.I.A. “annex” facility, during which two more Americans were killed.

Regardless of what the jurors decide on those counts, the guilty verdict on at least two charges — conspiracy to provide material support to terrorists and aiding in the malicious destruction of American property — means Mr. al-Imam is virtually guaranteed a lengthy prison sentence.

He became the second suspect to be tried successfully in federal court in Washington for a role in the deadly assaults, which took on broader significance as Republicans and conservative news outlets seized on them to try to damage the presidential ambitions of Hillary Clinton, then the secretary of state.