Editor's note: Peter Bergen is a director at the New America Foundation and the author of "Manhunt: The Ten-Year Search for bin Laden -- From 9/11 to Abbottabad."
(CNN) -- Al-Shabaab, al-Qaeda's brutal Somali affiliate, has claimed credit for the attack by multiple gunmen at an upscale shopping mall in Nairobi, Kenya that has already killed at least 59 people.
This should not be a surprise. For Al-Shabaab, the mall was an attractive target because Westerners, including Americans, frequented it. The mall is also in the capital of Kenya, a country that Al-Shabaab has good reason to dislike, as the Kenyan military played a major role in handing their forces a defeat last year when they liberated the key Somali port of Kismayo from their control.
Al-Shabaab ("the Youth") tweeted Saturday that "all Muslims inside #Westgate" -- referring to the mall that was attacked in Nairobi -- "were escorted out by the Mujahideen before" the armed assault commenced.
Members of Al-Shabaab use Twitter frequently to communicate their messages to the world. The group has recruited around 40 young American men and also dozens from Europe and has shown that it is comfortable with Internet technology, despite the fact that Somalia is one of the poorest and most anarchic countries on the planet.
More than 10% of the Kenyan population is Muslim. So it is interesting that Shabaab took the precaution of evacuating Muslims from the Nairobi mall they were attacking, suggesting a greater sophistication in the tactics of this attack than the group has shown hitherto in Somalia, where they have killed large numbers of civilians indiscriminately in a country that is almost entirely Muslim.
Before he was killed by U.S. Navy SEALs two years ago, even Osama bin Laden had scolded members of Al-Shabaab, telling them to try to avoid killing Muslim civilians.
In a letter that was recovered in the house in Pakistan where bin Laden was killed, al-Qaeda's leader warned Shabaab members that they were killing too many civilians in battles in and around the key Bakara market in the Somali capital, Mogadishu.
Saturday's attack on the Nairobi mall seems to owe some of its tactics to Lashkar-e-Taiba, the Pakistani terrorist group that attacked upscale hotels catering to Westerners in Mumbai, India, in November 2008 over the course of more than three days, killing 166 people.
In both the Nairobi and Mumbai attacks, a group of armed gunmen shot at civilians indiscriminately and conducted the operation in a manner that would guarantee sustained media coverage over many hours and even days by taking a large number of hostages. In both assaults, the gunmen did not negotiate for the release of hostages but went into the operation seemingly prepared for a fight to the death.
Al-Shabaab has previously shown that it is capable of carrying out operations outside of Somalia, bombing two groups of fans watching the World Cup on television in Kampala, Uganda, on July 11, 2010, killing more than 70. The group seemed to have carried out that operation because Uganda had provided troops to a United Nations-authorized African Union mission then fighting Al-Shabaab in Somalia.
The group has also shown an interest in targets in the West. Eight months before the attack in Uganda, a 28-year-old Somali man armed with a knife and an ax had forced himself into the home of Kurt Westergaard -- a Danish cartoonist who had depicted the Prophet Mohammed with a bomb in his turban -- and tried unsuccessfully to break into the panic room where Westergaard was hiding. Danish intelligence officials said the suspect had links with Al-Shabaab.
Al-Shabaab has managed to plant al-Qaeda-like ideas into the heads of even its American recruits.
Shirwa Ahmed, an ethnic Somali, graduated from high school in Minneapolis in 2003, then worked pushing passengers in wheelchairs at the Minneapolis airport. During this period Ahmed was radicalized; the exact mechanisms of that radicalization are still murky, but in late 2007 he traveled to Somalia.
About a year later, on October 29, 2008, Ahmed drove a truck loaded with explosives toward a government compound in Puntland, northern Somalia, blowing himself up and killing about 20 people, including United Nations peacekeeping troops and international humanitarian assistance workers. The FBI matched Ahmed's finger, recovered at the scene, to fingerprints already on file for him. Ahmed was the first American terrorist suicide attacker anywhere.
Al-Shabaab breaks new ground with complex Nairobi attack
The attack on the Nairobi mall may be an attempt by Al-Shabaab to signal its continued relevance. Over the past three years, Al-Shabaab has lost substantial territory and influence in Somalia. Al-Shabaab controlled much of southern Somalia in 2010, but operations by African Union and Kenyan forces have ended its domination of southern Somalia.
In 2011, the U.N.-sanctioned African Union mission partnered with Somali troops to fight Al-Shabaab militants, and in August of that year, African Union and Somali government forces defeated Al-Shabaab forces in Mogadishu, forcing the militants from a stronghold they had controlled since 2009.
Although Al-Shabaab has long been regarded as a regional offshoot of al-Qaeda, its leaders only declared their formal ties to the international terror organization in February 2012.
While the group seems to have been interested in an alliance before then, in 2010, bin Laden instructed the group's leaders to keep their association with al-Qaeda a secret, fearing that openly linking the groups would be bad for Al-Shabaab's fundraising efforts.
By February 2012, however, bin Laden was dead and Al-Shabaab had suffered significant losses in its southern Somali safe haven.
Al-Qaeda's new leader, Ayman al-Zawahiri, who had earlier petitioned bin Laden to reconsider his views about the proposed merger between Al-Shabaab and al-Qaeda, believed the time was right to announce formal ties between the two groups.
While there are a number of American citizens fighting for a variety of al-Qaeda-affiliated or -inspired organizations, Al-Shabaab seems to boast the most American fighters. According to a 2011 report by the House Committee on Homeland Security, an estimated 40 Americans have joined Al-Shabaab in the last few years, at least 24 of them coming from the Somali community in Minnesota.
Al-Shabaab has prominently featured these recruits in its propaganda operations, releasing three official videos that starred Abu Mansoor al-Amriki ("the father of Mansoor, the American"), who is actually Omar Hammami, in his late 20s from Alabama, who was raised as a Baptist and converted to Islam in high school.
One of the videos shows Hammami preparing an ambush and features English rap lyrics extolling jihad.
Hammami was reported to have been killed on September 12 during the course of some kind of an internal conflict within the Al-Shabaab group.
The news of his death was confirmed on Hammami's Twitter account four days later.