A Central Intelligence Agency officer and a U.S. Special Operations commando fatally shot two armed Yemenis last month during a botched kidnapping attempt in a commercial district of the volatile country, U.S. officials confirmed this weekend.

The Americans opened fire on armed Yemeni civilians to escape an apparent abduction attempt at a barbershop, a U.S. official said Saturday.

The U.S. embassy in Yemen has been operating on reduced capacity in recent days as U.S. officials there have sought to limit the movement and exposure of their personnel amid a flurry of threat warnings.

The State Department confirmed Friday night that it had flown out the two officials after the incident, which was first reported Friday night by the New York Times.

“We can confirm that, last month, two U.S. Embassy officers in Yemen fired their weapons after being confronted by armed individuals in an attempted kidnapping at a small commercial business district in Sanaa,” State Department spokeswoman Marie Harf said in a statement. “Two of the armed individuals were killed.”

Officials at the Pentagon and the CIA declined to comment on the incident.

The shooting made news in Yemen when it occurred a couple of weeks ago, but local reports did not identify the targets of the apparent kidnapping attempt as U.S. officials.

The Yemeni government has welcomed — and at times pleaded for — U.S. assistance to fight al-Qaeda in the Arabian Peninsula, an offshoot of the original terror group that is among the most worrisome to Washington because the group has plotted attacks against Western civilian targets. But the robust counterterrorism cooperation is rendered discreetly, in large part because many Yemenis deplore U.S. drone strikes.

A senior U.S. official said the Americans were flown out of Yemen shortly after the shooting with the acquiescence of local officials.

“There was no conflict with the Yemeni government when they left,” the official said. “It was done with the acknowledgment of the government.”

Disclosure of the incident coincided with fresh signs of deteriorating security in Yemen, where a weak government has struggled to battle Islamist insurgents linked to al-Qaeda.

According to local news reports, at least seven people were gunned down Friday after assailants opened fire at two checkpoints that lead to the presidential palace. Meanwhile, militants ambushed the convoy carrying the country’s defense minister outside the capital.

Yemen has been among the least permissive environments for U.S. officials in recent years. American military and intelligence personnel have played a crucial role in counterterrorism efforts in Yemen, regularly striking suspected militants with drones and providing support to the country’s fledgling security forces.

U.S. personnel in the capital live in a fortified building that used to be part of the Sheraton Hotel chain. Their movements outside the living quarters and the heavily guarded embassy are tightly limited.

U.S. officials would not say whether the Americans involved in the shooting were abiding by security rules when the incident occurred. Although U.S. diplomats are required to adhere to stringent security rules in conflict zones, intelligence personnel and special operators with advanced weapons training are often given more leeway.

“Per standard procedure for any such incident involving Embassy officers overseas, this matter is under review,” Harf said in the statement.

Greg Miller contributed to this report.