A hostage situation in Bamako, Mali, has ended with at least 18 people killed. Details are still streaming in, and much of what has been reported is still tentative. My colleague Adam Chandler has a running post on the facts so far.

The attack has drawn new attention to the West African country, but it’s just one milestone in a long-running conflict that has included a separatist civil war, a split between Islamist allies, a large foreign-military operation, and a comeback by jihadists. Even while Friday’s siege was ongoing, questions arose about whether the Bamako attacks were at all connected to last week’s Paris attacks by the Islamic State, or if they were intended as retaliation for French military intervention in Mali in 2013—just as ISIS portrayed the November 13 attacks in Paris as vengeance for French airstrikes in Syria and Iraq. But there are many facts still unknown, and the situation in Mali is too complicated to allow any simple answers.

Mali is shaped like an uneven bow tie, with Bamako and much of the nation’s population in the smaller, southwestern triangle. The upper, northeastern triangle is more sparsely populated, and includes a swatch of the Sahara Desert. Tuareg people living there have long resisted the Malian government’s control. Their decades-long, low-level rebellion gained firepower in early 2012, as arms streamed across the Libyan border after the death of Muammar al-Qaddafi. In the spring, as an army coup toppled the central government, the Tuareg separatist Mouvement National Pour la Libération de l’Azawad (MNLA) declared independence, saying it had formed a new state called Azawad.

The MNLA, which includes many secular Tuareg, was bolstered by its alliance with Islamist fighters with ties to al-Qaeda. But the MNLA soon found it was unable to contain its allies. The Tuaregs were pushed aside and some became refugees. The Islamists began imposing an extremely harsh style of rule in northern Mali, forcing many people to flee the area and suppressing those who stayed behind. They destroyed historical shrines and records in Timbuktu, capturing the world’s attention briefly. By January of 2013, The New York Times was counting at least six different Islamist groups operating in northern Mali, including Tuareg-led Ansar Dine, al-Qaeda in the Islamic Maghreb (AQIM), and the Movement for Unity and Jihad in West Africa.

Having established their power in the north, the now-jihadist-dominated rebels began marching southward. At that point, France sprang into action, driven in part by its colonial ties to the country. The military offensive it launched soon proved successful at dispersing the rebels. There are now some 3,000 French soldiers in the region.

France’s military victory was fast, but perhaps fleeting. The United Nations took over security from the French, but a year later, in March 2014, The Guardian reported that jihadists had slowly begun to creep back into northern Mali. Paul Melly, a Francophone Africa expert at Chatham House, told the BBC Friday morning that the French intervention had successfully scattered the Islamists, but it hadn’t eliminated them, a challenge made harder by geography.

“Jihadist groups dispersed across the desert,” he said. “In the Sahara, it’s very difficult to control people moving around.” They were also able to resupply their stores of money and weapons from Libya, Melly said: “This has sustained jihadist terrorist over the years since that major French intervention.”

The civil war officially ended in June with a signed agreement, but the jihadist forces summoned by the conflict were not gone. They had just turned into a much more decentralized, splintered Islamist movement, which has launched attacks around the country throughout 2015, including some that have reached well into southern Mali. June also brought reports of the death of Mokhtar Belmokhtar, a one-eyed Algerian and leading jihadist figure in the Sahara (he lost an eye in the Algerian Civil War). Belmokhtar is most famous for the January 2013 siege of a gas facility in Algeria, which was carried out by militants in his command. Around 40 people were killed and 800 were taken hostage.

Belmokhtar was a top al-Qaeda commander, but he eventually split from the group over management disagreements. His new organization later merged with the Movement for Unity and Jihad in West Africa to create a group called al-Murabitun. And he apparently patched over his differences with AQIM, because the group released a statement saying he was “alive and well” in June. Belmokhtar’s group has since claimed responsibility for some attacks on behalf of al-Qaeda.

In August 2015, militants attacked a hotel in Sevare, a city in central Mali. The assault presaged Friday’s attack in some ways. A band of gunmen stormed the hotel, where some UN officials were staying, and seized hostages. Thirteen people, including five UN workers and four Malian soldiers, died before the siege was ended. Al-Murabitun claimed credit for that attack. The group also claimed responsibility for a deadly May shooting at an expat bar in Bamako.

Al-Murabitun has now taken credit for the attack Friday at the Radisson Blu in Bamako, though officials have not confirmed the connection. There’s also no evidence so far to tie the attacks to ISIS. Melly told the BBC he was not aware of ISIS being active in Mali. Jean-Hervé Jezequel of the International Crisis Group is similarly cautious:

If [ISIS] turns out to be linked to the Bamako raid, it would be the first time that movement has taken action or been seen to be present there. IS certainly has no official representative or presence in Mali, even if there were rumours this summer that some radical leaders active in the north were looking for an IS affiliation.

One result of the complicated and tangled jihadist landscape in Mali is that figuring out who’s allied with who can be tricky. It’s not just the split between MNLA and their Islamist allies, and not even just Belmokhtar’s on-again, off-again relationship with al-Qaeda. Earlier this year, someone claiming to speak for al-Murabitun announced that the group was pledging its allegiance to ISIS. Several days later, Belmokhtar shot down that report as false.