Militants shot and killed a Western doctor and a Filipino nurse in front of their fellow medics in a hospital inside the Yemeni defence ministry compound after a suicide bomber drove his vehicle into the gates of the compound and killed 20 people in the blast.
The attackers were wearing national military uniforms when they attacked the compound in the capital of Sanaa, it was reported.
The gunmen were killed or captured in a gun battle after the explosion.
"The explosion was very violent, the whole place shook because of it and plumes of smoke rose from the building," an employee in a neighbouring building said.
The blast destroyed an armored vehicle and damaged the compound hospital.
Military helicopters were dispatched to the complex as smoke rose from the scene. State television launched an appeal for blood donors to come forward.
It remains unclear which group was responsible for the explosion although al-Qaida has conducted similar attacks in the region.
Yemen, a deeply impoverished country, is mired in an ongoing fight against al-Qaida in the Arabian Peninsula (Aqap) and government officials are frequently targeted.
The West has a stake in the stability of Yemen because of its strategic position close to vital shipping lanes and to Saudi Arabia, the world's largest oil exporter.
To contact the editor, e-mail: