Yemeni security forces have launched a sweep in the capital to find the perpetrators of a deadly attack on the country's defence ministry, sparking clashes that left several armed men killed, officials said.

Officials also said that Friday’s fighting in Sanaa left one member of the special forces dead.

The brazen attack on Thursday, claimed by al-Qaeda's local branch, killed 56 people including at least seven foreigners.

The attack also underscored the ability of fighters to take advantage of the country's instability and tenuous security - even at the headquarters of its military.

The assault on the ministry involved a suicide car bomb, and the ministry also came under heavy gunfire from nearby houses. Security forces raided several homes in the ministry's vicinity over the next 24 hours, sparking the clashes.

Al-Qaeda gained a major foothold in Yemen's south amid the chaos that followed the 2011 uprising that ousted Defence President Ali Abdullah Saleh.

Among the dead at the defence ministry complex, which also houses a military hospital, were soldiers and civilians.

Seven were foreigners, according to Yemen's Supreme Security Commission, which issued the casualty figures - two aid workers from Germany, two doctors from Vietnam, two nurses from the Philippines and a nurse from India.

Among the Yemeni civilians killed were a doctor and a senior judge, it said.

A spokesman for the Philippines' Department of Foreign Affairs, Raul Hernandez, said on Friday that seven Filipinos were killed in the attack, including a doctor and nurses, while 11 others were wounded.

The victims were among 40 Filipino workers in the hospital inside the complex. Hernandez said that the Philippines' honorary consul reported that the others survived by pretending to be dead.

It was not immediately possible to reconcile the Yemeni death toll with the account from the Philippines.

'Legitimate targets'

Also on Friday, Germany said it was temporarily reducing its embassy staff in Yemen and told its aid workers to leave the country "as quickly as possible".

The German embassy in the Yemeni capital will operate "in emergency mode with reduced personnel" and with appropriate security measures, a foreign ministry spokesman told reporters.

A twitter account that has previously carried statements from al-Qaeda in the Arabian Peninsula said on Twitter :"As part of the policy of targeting the operation rooms of pilotless planes, the mujahideen (holy fighters) have heavily struck one of these rooms in Defence Ministry headquarters".

"Such joint military locations, which participate with the Americans in their war against this Muslim nation, are a legitimate target for our operations," another tweet said.

The US considers the Yemeni al-Qaeda branch to be the most active in the world.

In recent months, Washington has sharply escalated drone attacks against armed groups in the impoverished nation.

US forces also have been training and arming Yemeni special forces, and exchanging intelligence with the central government.