The US embassy compound in Sanaa.
The US embassy compound in Sanaa. (Reuters)

US government personnel shot dead two men who attempted to kidnap them in the commercial district of the volatile Yemeni capital Sanaa.

According to a report in the New York Times, the men were in a barber's shop in the centre of the city on 24 April when they opened fire on two armed civilians.

In the report, they were identified as a Special Operations commando and a Central Intelligence Agency officer.

In recent days, the US embassy in Yemen has been running at a limited capacity, after a series of threats and attacks on western interests put staff on lockdown.

The two officials at the centre of the incident have been whisked out of the country, the State Department confirmed.

"We can confirm that, last month, two US 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," the State Department said in a statement. "Two of the armed individuals were killed."

The CIA and Pentagon declined to comment.

In recent weeks, there has been a surge of violence in the capital, as the government battles Islamist militants linked with al-Qaida.

The US embassy was closed earlier this week after militants opened fire on three French security personnel working with the EU mission in Sanaa, killing one and wounding another.

On Friday, according to local media reports, at least seven people were killed when militants opened fire at two checkpoints leading to the presidential palace.

Later that day, militants ambushed the motorcade of Yemen's defence minister in a failed assassination attempt.

In recent years, that US has worked closely with the Yemeni government to battle the threat from terrorism, providing support to the country's security forces, and launching a campaign of deadly drone attacks on suspected al-Qaida militants in the country.