"We commend the brave and swift response by the Somali security forces ... and send our deepest condolences to the families and loved ones of the victims of this heinous act," she added.
Al-Shabab gunmen detonated multiple bombs at the front gates of the headquarters and raked the building with machine gun fire and rocket-propelled grenades, according to reports by The Associated Press.
African Union and Somali military forces arrived on the scene and beat back the assault, killing all 16 al-Shabab members in the process, Ben Parker, a spokesman for the United Nations Assistance Mission in Somalia, told the AP.
But the gunmen were able to kill nine individuals, including three foreign nationals, before they were killed by local security forces.
Among the dead were two South African contractors working for the organization, according to reports. Nicholas Kay, the top U.N. envoy in Somalia, was not in the compound at the time of the attack.
The brazen attack was another example of the terror group's willingness to drive Somalia and the region further into chaos and bloodshed, according to Hayden.
"Al-Shabaab has shown again and again that it stands on the side of death and destruction," she added.
The group, along with the Nigerian-based Boko Haram and al Qaeda's West African cell known as al Qaeda in the Islamic Magreb (AQIM) have increased their ties over the past several years.
That cooperation has made al Qaeda's West African organization into one of the group's most dangerous factions, second only to al Qaeda's Yemeni cell known as al Qaeda in the Arabian Peninsula.
The combination of lucrative kidnapping-for-ransom operations and a steady flow of arms and recruits stemming from the 2011 Libya uprising has led to AQIM's rise to power within the terror organization, according to former Africa Command chief Gen. Carter Ham.
"We believe the most dominant organisation is AQIM. We think they are al Qaeda's best funded, wealthiest affiliate," the four-star general said last July.
The State Department put a $7 million bounty on the head of Boko Haram chieftain Abubakar Shekau in June.
Earlier this year, French forces wrapped up a massive counter terrorism operation against AQIM, driving the group from its safe havens in the northern half of the African country of Mali.
Members of the European Union and the United Nations are already planning to move military advisers into the West African nation, to train and organize Mali's armed forces, Michael Sheehan, head of the Pentagon's special operations and low-intensity conflict directorate, told Congress in April.
That said, the Obama administration has barred the Defense Department from providing any support to the Malian military, Sheehan said at the time.