Al-Shabaab’s successful attack on Nairobi’s Westgate Mall should not be seen as a progressive step in the group’s growing power and influence, but as a direct result of the infighting — one fueled by Twitter, YouTube and other social media platforms — that has rocked al-Shabaab since its merger with al-Qaeda in early 2012.

Al-Shabaab, a pioneer jihadist organization on social media, was one of the first such groups to harness the power of Twitter to inspire followers, lure recruits and lambast enemies. Its well-crafted tweets served as an example to Islamist groups around the world that social media was a powerful gateway to communicate grievances and perceptions to the world.

But what the al-Qaeda-allied group didn’t realize — like so many leaders and groups that have faced popular revolutions in recent years — is that social media cuts both ways. Although Twitter gave al-Shabaab an effective tool to spread its propaganda, the social media platform also empowered internal factions, giving them a potent voice of dissension that Somali citizens, group members and the world at large could easily reach and hear.

Awareness of the widening rift between al-Shabaab factions grew as improvements to infrastructure spread across Somalia, following the takeover of major cities and towns by Somali government and international forces. Once dependent on getting news only by radio, Somali citizens began to get information from the internet via the rapid spread of mobile phone technology across the country. In the past two years, Somalis have flocked to Facebook, Twitter and the burgeoning number of Somali-language media sites, opening up their worldview beyond the country’s borders and exposing them to viewpoints of local events previously never touched upon.  

For top al-Shabaab commander Ahmed Abdi Godane and his lieutenants, this was an agonizing development. Not only were their fighters being pushed out of all the major cities and towns, large numbers of Somalis — and more damaging the rank and file members of the militant group — were gaining access to an array of news sources not controlled by Godane’s faction.

For nearly two years, various al-Shabaab members feuded openly on social media and jihadist forums over the question of what form and direction the militant group should take in light of its military setbacks and loss of morale. One of the major issues separating the factions was whether sanctioning the use of terrorist acts against innocent civilians adhered with sharia law and was in-line with the group’s long term objectives. The growing authoritarian nature of Godane, whose refusal to compromise with the other top leaders, also embittered rivals against him.  

The most recognized critic of Godane was FBI most-wanted terrorist and US citizen Omar Hammami (Abu Mansour al-Amriki), who repeatedly blasted the top al-Shabaab leader via Twitter and a series of widely publicized videos since the al-Qaeda merger. Godane at first did nothing against Hammami, but when his defiant videos and Twitter activity began to attract more attention from the local and international media, Godane decided to use the group’s propaganda machine to fight back. Via al-Shabaab’s Twitter account, Godane released a number of extended statements in the past year denouncing the Alabama native, saying Hammami represented neither al-Shabaab nor the foreign jihadists in Somalia. But as the pursuit of Hammami and his followers became more aggressive in the public sphere and on the ground, a group of senior al-Shabaab leaders began openly opposing Godane on social media and jihadist forums.

Most important among those public criticisms was a statement posted online in April by al-Shabaab co-founder Ibrahim al-Afghani, who “on behalf of the silent majority” pleaded for al-Qaeda leader Ayman al-Zawahiri to intervene to stem the growing dissatisfaction within the militant group and sideline Godane. Another letter the same month from foreign fighter leader Zubayr al-Muhajir accused Godane of imprisoning and torturing to death those opposed to his rule. Such open revolt within the group had never been publicly aired, and social media was providing the stage.

For the top commander, the moment to strike had come. The dissension had spread from an attention-seeking American jihadist and his followers to senior al-Shabaab leaders who had influential sway over the rank-and-file members. In late April, Hammami detailed on Twitter an alleged assassination attempt against his life when Godane loyalists tried to gun him down. In response, the senior level al-Shabaab leaders now allied with Hammami’s cause issued a joint fatwa forbidding the jihadist’s killing, but Godane quickly brushed this religious edict aside.

Crossing a Rubicon of sorts, Godane dug in his heels and mustered a public relations strategy using Islamic precepts to instill obedience within the al-Shabaab rank-and-file and justify hunting dissenters down. In one such message released on Twitter in May, Godane warned al-Shabaab members that infidels were attempting to tear the organization apart by questioning his leadership and commitment to jihad. The letter, much like another such letter published in June, used hadiths (quotes of the Prophet Mohammed) to compel al-Shabaab members to “stop gossipping and asking questions” and obey Godane or risk the wrath of God.

These desperate attempts to shore up support for Godane’s cause may have worked well several years ago when al-Shabaab dominated southern Somalia and its radio stations, but in the country’s new media landscape — in which covering once taboo subjects like al-Shabaab is now commonplace, and where Somali citizens and al-Shabaab members have access to the internet and social media — these messages seemingly did little to stem the growing opposition. 

The infighting finally came to a head in late June, not coincidentally the same day an al-Shabaab suicide unit struck the UN complex in Mogadishu, an attack that carried many of the hallmarks of the future Westgate rampage. Godane loyalists descended onto the southern Somali town of Barawe and engaged in an unprecedented open battle against rival members. Far outnumbering and outgunning the dissenters, his fighters killed scores of the rival faction, while many others fled. In a symbolic gesture of power, Godane fighters captured al-Afghani and executed him alongside Sheikh Maalim Burhan, who allegedly was tipped to succeed Godane as top al-Shabaab commander.

Hammami, who escaped the battle, went into hiding for months in the forests of southern Somalia and ceased all Twitter activity. But in early September, after his wives were said to have been imprisoned by Godane, he re-emerged and conducted a phone interview with Voice of America. In that interview, Hammami said Godane was trying to kill him because he knew too much about the organization and the degree to which it did not adhere to sharia law. The top commander was apparently trying to prevent such news to reach the upper echelons of al-Qaeda in Yemen and Pakistan that gave him financial and public support. Only a week later, Godane loyalists tracked Hammami down and killed him along with several of his followers. 

Alone at the top following this series of mafia-style executions, Godane, finally free of internal encumbrances, was able to pursue his agenda and cement his leadership. Viewed in this context, Westgate mall provided an ideal next target. The four-day siege not only affirmed his position as top commander of a group with regional ambitions, it also proved to be a stark indication of what direction the jihadist group, however fractured, may now be heading. 

But Godane should not get too comfortable. With the stability of the militant group in doubt and Hammami and others as examples, currently silent dissenters within al-Shabaab now know a series of 144-character Tweets — not just ammo in their Kalashnikovs — is enough to seriously rock this terrorist boat.

Paul Hidalgo is US foreign policy analyst with specializations in the Horn of  Africa and the Middle East. 

Disclaimer: The author is a guest contributor and not associated with any of the Atlantic Council’s programs, the views expressed in this piece belong to the author.