The assault by al-Qaeda gunmen on an Ivorian beach on Sunday, 13 March was, in many ways, an attack waiting to happen. Since the collapse of Mali's north in 2012, a number of jihadi groups have taken advantage of the ensuing insecurity, using the region as a base to launch attacks. Though no one could be sure which of Mali's neighbours would be targeted next or how well the security forces would respond, the Côte d'Ivoire assault itself was only a matter of time.

Sixteen people died when militants hit the Grand Bassam L'Etoile du Sud hotel and beach resort. Fourteen were civilians – four foreigners – and two were members of the Ivorian special forces. Between three and six attackers were also reportedly killed. Al-Qaeda's North African affiliate, al-Qaeda in the Islamic Maghreb (AQIM), claimed responsibility in less than 24 hours. AQIM has a history of attacking foreign targets across the Sahara, and increasingly in the Sahel. The group rejects the presence and influence of Westerners in particular, as well as rejecting the legitimacy of elected African governments as it seeks to implement Islamist governance in the region. AQIM also seeks to purge the region of what the group's leadership sees as corrupting un-Islamic practices. Côte d'Ivoire fits AQIM's criteria as a target because it hosts foreign troops, including French forces involved in Mali, and with a secular, democratically elected government it is open to Western culture.

Since the Malian collapse, there have been several high-profile attacks on international targets in the region. On 16 January 2013, for instance, al-Mouribatoun, an AQIM splinter group led by the notorious Mokhtar Belmokhtar, seized the In Amens gas facility in southern Algeria. Forty hostages and 29 insurgents were killed when Algeria's military broke the siege.

The region has seen several high-profile attacks on international targets.

On 7 March 2015, al-Mouribatoun claimed responsibility for an attack on a nightclub in Bamako, Mali's capital, which killed five people. On 20 November, 2015, three gunmen hit the Raddisson Blu Hotel in the city. At least 20 people were killed. Al-Mouribatoun and AQIM jointly claimed responsibility for that attack. Around the end of 2015, there were reports that the two groups had merged. Their cooperation in November and again in January 2016 – when they both claimed to be behind a deadly attack on a hotel and café in Burkina Faso's capital Ouagadougou – seemed to confirm those rumours.

The attack in Burkina Faso's capital, in which 30 were killed, was the second such attack in a country without a homegrown Islamist insurgency. Following that incident, other countries neighbouring Mali increased their security around places popular with foreigners to guard against spillover. Senegal began a security crackdown on extremist imams in the country in a series of arrests in November 2015. Côte d'Ivoire has also been increasing its security, especially along its northern border with Mali, since a 2015 threat from Malian jihadi group Ansar Dine. Those threats came in retaliation for Côte d'Ivoire's involvement in the counter-terror campaign in Mali, and for its hosting French troops.

Amid the threat of extremist violence spreading from Mali, its neighbours expected to be targeted. The low death toll in Sunday's attack, and the fact that two soldiers were among the dead, indicates that Côte d'Ivoire security forces were prepared for such an eventuality, and that they responded quickly. The gunmen did not seize the hotel itself, there was no hours-long siege; the attackers' window of opportunity was short.

What all these attacks have in common is a focus on foreigners.

What all these attacks have in common is a focus on foreigners. In all of them individuals or small groups of gunmen hit soft targets. With this pattern in mind, the annual American-led, multi-African national military exercises, Flintlock, in January included African policemen and were led in part by the US Federal Bureau of Investigation. This was an acknowledgement that counter-terrorism will not always be the purview of the military battling militants away from populated areas. Such efforts will also take place in urban areas, and within the framework of existing security and law enforcement work.

Attacks like the one on Sunday in Côte d'Ivoire are not aimed at seizing territory or establishing bases. The militant groups behind such attacks aim to terrorise, and project strength beyond their geographic location. They are also aimed at undermining domestic and international trust in the government and security forces and gaining propaganda points among jihadi groups in a cycle of violent 'one-upmanship.'

But they also aim to grab the attention of disillusioned local and regional populations. These assaults have not targeted mosques, markets, or even government buildings. Instead they have set their sights on foreigners and symbols of international wealth. In this way, al-Qaeda's affiliates on the continent draw attention to the vulnerability of the West, and feed their narrative of fighting injustice, and the rich, on behalf of the poor.