Spain's Defense Ministry have said an air force sergeant and two corporals were wounded on Saturday night at the cafe packed with soldiers of different nationalities.
"According to the initial indications from the investigation, the three dead include two suicide bombers of Somali origin, a man and a veiled woman. Out of the wounded, four are in a serious condition," the agency quoted the interior ministry as saying.Quoting an interior ministry statement, Djibouti's ADI news agency said the attackers were from Somalia, where Djiboutian troops are part of an African Union force fighting Al-Qaeda-linked Shebab rebels.
Spanish officials have said the blast was caused by a grenade, but German officials claim it’s not yet known if this is was the case.
The attack targeted La Chaumiere, a restaurant reported to have been packed with westerners.
The French foreign ministry confirmed that several of its nationals were slightly wounded in the attack, and the Netherlands' De Telegraaf reported that six Dutch soldiers who had been taking part in an anti-piracy mission were also slightly hurt.
There was no immediate claim of responsibility for the attack, although Djibouti's President Ismail Omar Guelleh was quoted as saying by ADI that the attack was a "violent reaction to our participation in the process to stabilise and secure the region".
The president also vowed to "do everything to find those who ordered this barbaric attack", and said "this act of blind terrorism will not change our determination to fight alongside the international community".
The Horn of Africa nation of Djibouti, a former French colony, is home to the United States' biggest base in Africa which is used for anti-terror operations in Yemen, Somalia as well as for other operations across Africa.
France also maintains a military base in Djibouti.
Djibouti is also a key contributor of troops to the African Union force in Somalia, and the Shebab have already carried out attacks against Kenya and Uganda, who also have forces in Somalia.
Djibouti's port also serves as a key base for ships taking part in international anti-piracy operations off the Somali coast.
The operation to protect international shipping lanes in the Gulf of Aden has led to a sharp drop in piracy in recent years.