WASHINGTON — The German government ordered the CIA’s top officer in Berlin to leave the country Thursday in an extraordinary escalation of a conflict between the two allies over American espionage.

The move amounts to a high-profile expression of German anger over alleged CIA operations uncovered by German investigators in recent weeks, as well as continued public outrage over the exposure last year of widespread U.S. surveillance programs whose targets included Chancellor Angela Merkel.

A spokesman for the German government, Steffen Seibert, confirmed the expulsion of the CIA station chief in a statement that made clear Berlin regards U.S. espionage efforts as a breach of trust.

“The representative of the U.S. intelligence services at the Embassy of the United States of America has been requested to leave Germany,” Seibert said. Continued cooperation would require “mutual trust and openness,” Seibert said. “The Federal Government continues to be ready for this and expects the same from its closest partners. ”

The decision means that the United States will be forced to withdraw an officer who oversees U.S. spying programs in Germany but also serves as the main point of contact with German intelligence services – exchanging information on subjects ranging from terrorist plots to Iranian nuclear ambitions.

In ordering the CIA station chief to leave, Germany resorted to a form of retaliation that is occasionally employed by determined espionage adversaries – such as the United States and Russia – but rarely by such a close ally.

“I can’t recall ever getting to the point where a friendly service actually ejected somebody,” said John Rizzo, who spent more than three decades at the CIA and served as its acting general counsel. “The Germans must feel compelled to do this for political reasons because there are certainly ways to convey one’s displeasure without taking this kind of overt step.”

Former officials described the outgoing CIA station chief as an agency veteran, a German speaker who has held a series of overseas posts as well as assignments at headquarters in the agency’s European division.

Before ordering him out, Germany “had to make a calculation of what they were going to lose – they get a substantial amount of intelligence from us,” said a senior former U.S. intelligence official who worked closely with Berlin and spoke on the condition of anonymity because of the sensitivity of the subject. “There will be people in the (U.S.) intelligence community who will want to say, ‘That’s it.'”

Former U.S. officials said the agency pulled back on certain spying operations last year amid concern about the fallout from the Edward Snowden leaks.