WASHINGTON — A Minnesota woman who worked as a translator for the military in Iraq was charged on Wednesday with providing highly classified information to an Iran-backed militia group. Prosecutors said she intensified her espionage as tensions between the United States and Iran increased in recent months.

Prosecutors said the contractor, Mariam Taha Thompson, 61, revealed to a Lebanese man with ties to Hezbollah the names of foreign informants and details of the information they provided to the United States. The identities of such informants are among the government’s most closely held secrets, and law enforcement officials said Ms. Thompson endangered the lives of the sources as well as those of military personnel.

The officials suggested that the potential loss of classified information was grave and that the prosecution was one of the most serious recent counterintelligence cases they had seen. Several top national security prosecutors as well as the U.S. attorney for the District of Columbia, Timothy Shea, appeared in court on Wednesday as Ms. Thompson made an initial appearance before a judge, demonstrating the importance of the case.

“If true, this conduct is a disgrace, especially for someone serving as a contractor with the United States military,” John C. Demers, the assistant attorney general for national security, said in a statement. “This betrayal of country and colleagues will be punished.”