Militants who seized the northern Mozambique town of Palma this week, murdering residents and forcing energy giant Total to suspend work on a nearby gas project, have wreaked havoc in the area for more than three years.
In October 2017, about 30 armed men launched a dawn raid on three police stations in Mocimboa da Praia, a port city in the province of Cabo Delgado, a predominantly Muslim region bordering Tanzania.
"We all knew they were dangerous, but we never thought they were capable of waging a war," said a local imam who was then based in Mocimboa da Praia -- about 80 kilometres south of Palma.
Three years later, the conflict has taken root and the group Ahlu Sunnah Wa-Jama (ASWJ), has triggered a humanitarian crisis akin to the end of Mozambique's 1977-1992 civil war.
Their attacks have left at least 2,600 people dead, half of them civilians, and uprooted nearly 700,000 people.
Last year the jihadists grew bolder, escalating attacks and posting brazen videos of unmasked fighters waving black flags and pledging allegiance to ISIS.
In August last year they seized the town of Mocimboa da Praia again and are still in control.
Their tactics have involved burning villages and beheading locals as Mozambican troops struggle to regain ground in the remote, forested province, despite help from private military companies.
Today the militants are in control of Palma, a town just 10 kilometres (six miles) from the nerve centre of the mega gas project that represents one of the biggest investments in Africa, led by the French energy group Total.
Armed militants moved in on Palma, a coastal town of 75,000 people, from three different direction on the afternoon of March 24. Locals and some 200 workers fled.
Institute for Security Studies (ISS) senior researcher Martin Ewi says authorities knew of the imminent attack "because there was intelligence that an attack was going to occur at least for three days before", but did nothing to prevent it.
Witnesses told Human Rights Watch they "fired indiscriminately at people and buildings", leaving several bodies lying on the street.
The violent, calculated raid broke a three-month hiatus in Islamist attacks widely attributed to counter-insurgency tactics and the January to March rainy season.
The attack came exactly two weeks after the US State Department labelled the group known also as al-Shabaab, an IS-linked terror group, saying it "reportedly pledged allegiance to (IS) as early as April 2018".
It blacklisted Abu Yasir Hassan, saying he was the leader of ISIS-Mozambique.
Thousands of troops have been deployed to Cabo Delgado, but Mozambique's ability to fight the insurgency has long been questioned, with analysts pointing at poor training and lack of equipment.
Government has hired a South African private military company Dyck Advisory Group (DAG), which is also reportedly discreetly being assisted by the Russian mercenaries, Wagner.
Rights watchdog Amnesty International has accused the militants, government troops and private military companies of "war crimes" by causing hundreds of civilian deaths.
The US announced this month that American military personnel would spend two months training soldiers in Mozambique to help the country fight the jihadist insurgency.
Alexander Raymakers, senior Africa analyst at the UK-based risk intelligence firm Verisk Maplecroft, suggested the militants had "used a lull in the fighting" to prepare a "high profile" operation.
"It's a clear demonstration that ASWJ has steadily increased its military capabilities, grown in sophistication and retains the initiative."