(CNN) -- Al-Shabaab said it attacked an African Union military base in Somalia on Thursday in retaliation for a U.S. airstrike that killed their leader near Barawe in September.
"Al-Shabaab has carried out the AU military base attack to revenge the killing of our leader, Ahmed Godane," the group's spokesman Ali Dheere said on Andalus radio,a pro-Al-Shabaab broadcaster, Friday.
Seven Al-Shabaab militants are dead after they attacked Somalia's largest base for African Union troops, according to the African Union Mission in Somalia.
Two militants in a car detonated themselves inside the Halane Military base in Mogadishu, AMISOM spokesman Ali Aden Houmed said.
Three AU soldiers from Uganda and a civilian died in the attack, AMISOM said on its website. Seven Al-Shabab soldiers were killed, AU said.
The heavily fortified base also houses several U.N. and international agencies.
"I condemn this reprehensible attack on the AMISOM base camp in Mogadishu which also hosts the UN Headquarters for Somalia," U.N. Special Envoy for Somalia Nicholas Kay said.
He praised the quick response of AU forces to the attack.
Maman S. Sidikou, special representative of the AU Commission chairperson (SRCC) for Somalia and head of AMISOM, offered his condolences to the families of the victims and "applauded the quick response and bravery of the ... troops in quelling this reprehensible attack," according to AMISOM.
Al-Shabaab has been waging war in Somalia in an effort to implement a stricter form of Islamic law, or sharia.
Established in 2007, the U.N.-backed AMISOM currently has some 20,000 African Union troops deployed in the impoverished nation to "conduct peace support operations" and to "stabilize the situation."
(CNN) -- The attack is harrowing: Al-Shabaab militants raid a quarry in Kenya, separating non-Muslim workers from their Muslim counterparts and executing them.
The brutal act comes just days after the Islamists ambushed a bus and sprayed bullets on those who failed to recite Quran verses.
The attacks reminded the world once again how brazen the group can be.
What does Al-Shabaab want? Here's an explainer.
What is Al-Shabaab, and what does it want?
Al-Shabaab is a Somali group that the United States designated as a foreign terrorist organization in March 2008. It wants to turn Somalia into a fundamentalist Islamic state, according to the Council on Foreign Relations.
The group has been blamed for attacks in Somalia that have killed international aid workers, journalists, civilian leaders and African Union peacekeepers.
It has a history of striking abroad, too. Before admitting to the Kenya quarry attack, Al-Shabaab was responsible for the July 2010 suicide bombings in Kampala, Uganda, that killed more than 70 people, including a U.S. citizen, who had gathered at different locations to watch the broadcast of the World Cup Final soccer match.
How big is it?
The total size of Al-Shabaab is not clear.
In 2011, A U.S. official who declined to be identified because of the sensitivity of the information said Al-Shabaab was estimated to control up to 1,000 fighters.
A U.N. report identified one insurgent leader who is believed to command "an estimated force of between 200 and 500 fighters," most of them Kenyans.
And Al-Shabaab has links to other organizations. In February 2012, the group's leader, Ahmed Abdi Godane, and al Qaeda leader Ayman al-Zawahiri released a video announcing the alliance of the two organizations.
How did Al-Shabaab start?
Decades of weak government amid grinding poverty have long made Somalia a target for radical Islamist groups.
Al-Shabaab's predecessor was al-Ittihad al-Islami (AIAI), which worked to create an Islamist emirate in Somalia. It was, in part, funded by former al Qaeda leader Osama bin Laden, according to the Council on Foreign Relations.
AIAI, which the U.S. State Department designated as a terrorist group, strengthened after the fall in 1991 of Siad Barre's military regime and amid the years of lawlessness that ensued.
In 2003, a rift erupted between IAIA's old guard -- who were seeking to establish a new political front -- and its younger members, who were seeking to establish fundamental Islamic rule. (Al-Shabaab means "the youth.")
That strife led the younger members to ally with a group of Sharia courts -- the Islamic Courts Union (ICU) -- that were seeking to impose order over a landscape marked by feuding warlords in the capital city.
Working together, the Islamic Courts Union and Al-Shabaab gainied control of Mogadishu in 2006. That sparked fears in neighboring Ethiopia that violence would spill over there, according to the Council on Foreign Relations.
Those fears -- combined with a request from Somalia's transitional government -- led Ethiopian forces to enter Somalia in December 2006 and to remove the ICU from power.
And that move inflamed Al-Shabaab, which attacked Ethiopian forces and gained control of parts of central and southern Somalia, according to a 2011 case study by Rob Wise, who was then with the Counterterrorism Program at the Center for Strategic and International Studies.
What is Al-Shabaab's relationship with neighboring countries?
In 2011, after attacks on tourist destinations in northern Kenya blamed on Al-Shabaab, the Kenyan government ordered a cross-border incursion aimed at creating a security buffer zone in southern Somalia.
Ethiopian troops have also crossed the border and expelled Al-Shabaab from Baidoa, a strategic town midway between the Ethiopian border and Mogadishu.
The group then targeted African Union soldiers and government buildings in the capital in suicide attacks. A suicide bombing in March 2012 killed five people at the presidential palace.
Analysts say tension appears to have been growing within Al-Shabaab between Somalis and foreign fighters, several hundred of whom are thought to have entered Somalia in recent years to join the group.
How does Al-Shabaab recruit?
The group has a sophisticated public relations arm that includes a Twitter account and video production abilities.
Al-Shabaab has even made a video is as slickly produced as a reality TV show, complete with a hip-hop jihad voice and a startling message:
"Mortar by mortar, shell by shell, only going to stop when I send them to hell," an unidentified voice raps in English.
But Al-Shabaab's enemies -- and alliances -- can shift.
Al-Amriki, whose real name is Omar Hammami, said in a video posted online last year that he had had a fallout with Al-Shabaab "regarding matters of the Sharia and matters of strategy" and feared for his life.
He was reportedly killed in Somalia by Al-Shabaab. CNN was not able to confirm the report.
Finding replacements might not be difficult.
Sheikh Ahmed Matan, a member of Britain's Somali community, said he knows of hundreds of young Somali men living in the West who returned to Somalia for terrorist training.
How is Al-Shabaab funded?
The once-ragtag al Qaeda affiliate has grown into an economic powerhouse, raising tens of millions of dollars in cash from schemes that have involved extortion, illegal taxation and other "fees," according to the 2011 United Nations report.
The United States believed then that the group was coordinating with al Qaeda groups in Yemen and might have been plotting attacks in the region and abroad.
In 2011, it was generating "between $70 million and $100 million per year, from duties and fees levied at airports and seaports, taxes on goods and services, taxes in kind on domestic produce, 'jihad contributions,' checkpoints and various forms of extortion justified in terms of religious obligation," according to the report from the U.N. Monitoring Group on Somalia and Eritrea.
How have Somalis been affected?
In 2011, the U.N. declared a famine in the southern Somalia regions of Bakool and Lower Shabelle, and Al-Shabaab reversed an earlier pledge to allow aid agencies to provide food in famine-stricken areas.
That year, the U.N. Interagency Group for Child Mortality Estimation said Somalia had the highest mortality rate in the world for children ages 4 and younger.
About 258,000 Somalis died in the famine between October 2010 and April 2012, and half the victims were younger than age 5, according to a report from the U.N. Food and Agriculture Organization and the USAID-funded Famine Early Warning Systems Network.
What is the United States doing?
The United States has supported U.N.-backed African forces fighting Al-Shabaab and strengthened its counterterrorism efforts against the group.
It has also donated millions of dollars in aid.
What is the status of Somalia's government today?
In September 2012, Somali parliament members selected Hassan Sheikh Mohamud as the new president in a vote that marked a milestone for the nation, which had not had a stable central government since Barre's overthrow 21 years earlier.
But that didn't mean Al-Shabaab was calling it quits. In January 2013, French forces attempted to rescue a French intelligence commando held hostage in Somalia by the group. The raid left the soldier dead, another soldier missing and 17 Islamist fighters dead.
But there has been political progress in Somalia.
In January 2013, for the first time in more than two decades, the United States granted official recognition to the Somali government.
CNN's Tim Lister, Barbara Starr, Paula Newton, David McKenzie and Elise Labott contributed to this report.