* Two foreign staff killed in front of their colleagues
* President tours site, orders an investigation
* Security in Yemen is a major concern for Western countries (Updates with Westerners killed, adds details, president tours site)
By Mohammed Ghobari
SANAA, Dec 5 (Reuters) - A car bomber and gunmen dressed in army uniforms attacked Yemen's Defence Ministry compound in the capital Sanaa on Thursday morning, killing at least 20 people, two sources said, in one of the worst attacks in Yemen in 18 months.
No one has claimed responsibility for the attack. But the country has been grappling with a security threat by al Qaeda-linked militants, who have repeatedly attacked government officials and installations over the past two years.
Security in Yemen is an international concern. The U.S.-allied country shares a long border with Saudi Arabia, the world's top oil exporter, and is home to one of the most active branches of al Qaeda that has plotted attacks against Western targets.
Security forces retook the compound after killing most of the attackers, the Defence Ministry said in a statement on its website.
A medical source and a ministry official said the gunmen had pulled at least two foreign employees, a Western doctor and a Filipina nurse, into the hospital courtyard and shot them dead in front of local staff.
The attack began as ministry employees were arriving for work when a vehicle exploded at the compound's gate, two sources inside the ministry said. The ministry's official statement made no reference to a suicide attacker.
"The attack took place shortly after working hours started at the ministry, when a suicide bomber drove a car into the gate," the Defence Ministry source said.
The massive blast shook the bustling Bab al-Yemen neighbourhood on the edge of Sanaa's old city, a warren of market stalls and stone tower houses decorated with stained glass windows and ornate plasterwork.
Plumes of smoke billowed over the area, where the country's central bank is also located.
"The explosion was very violent, the whole place shook because of it and plums of smoke rose from the building," an employee who works in a nearby building told Reuters.
Ambulance sirens and gunshots were heard after the blast as a second vehicle entered the compound carrying armed men dressed in Yemeni army uniforms and exchanged fire with soldiers.
Yemeni President Abd-Rabbu Mansour Hadi later visited the compound, met senior military officials and ordered an investigation into the attack.
"The attackers have exploited some construction work there to carry out this criminal act ... the situation is under control," the ministry said in its statement.
The construction work was taking place near the compound's hospital facility, the statement said.
The Defence Ministry said that most of the gunmen were "wiped out" in the ensuing battle but added that two had escaped into a nearby building where they were pursued by security forces.
A military source put the death toll at more than 20, including medical staff, soldiers and gunmen, and said dozens were also wounded. The Yemeni Health Ministry appealed to citizens to donate blood to help save the wounded.
Violence is common in Yemen, where an interim government is grappling with southern secessionists, al Qaeda-linked militants and northern Houthi rebels, as well as severe economic problems inherited from former president Ali Abdullah Saleh who was forced out of office in 2011.
Islamist insurgents were emboldened by a decline in government control over the country during protests that eventually ousted Saleh.
They seized several southern cities before being driven out in 2012 in a government offensive aided by U.S. drone strikes.
Al Qaeda militants have since killed hundreds of Yemeni soldiers and members of the security forces in a series of attacks, particularly in the southern provinces of the country.
In August, a U.S. warning of a possible major militant attack in the Middle East prompted the closure of several Western missions in Yemen and U.S. missions in several other Arab states.
In July last year, a suicide bomber wearing a Yemeni army uniform killed more than 90 people rehearsing for a military parade in Sanaa. Al Qaeda later claimed responsibility for the attack.
The defence minister, Major General Muhammad Nasir Ahmad, escaped a car bomb on his motorcade in September 2012 that killed at least 12 other people.
Ahmad is currently in the United States for annual discussions on relations between the two countries, officials said. (Reporting by Mohammad Ghobari; Writing by Maha El Dahan and Sami Aboudi; Editing by Angus McDowall and Sonya Hepinstall)