By Ian Wafula, BBC News, Africa Security Correspondent
“If [the jihadists] knew I was a government official, they would have beheaded me,” Tomas Langa, a civil servant in northern Mozambique, told the BBC.
He feels he had a lucky escape. We have changed his named for his safety.
Woken in the early hours of 10 May by heavy gunfire, Mr Langa looked out of his window to see four armed men standing outside his house in Macomia town in the insurgency-hit Cabo Delgado province.
He was terrified and ran into the countryside, where he hid for three days living on cassava plants.
“I was lucky they only insulted me as I ran,” he said.
Fighters linked to the Islamic State (IS) group targeted government buildings and positions in the town before looting shops and warehouses.
The gunmen kept the area under siege for two days, creating an atmosphere of fear and chaos.
The jihadists raided a medical facility run by aid agency Médecins Sans Frontières (MSF), seizing vehicles and medical supplies.
MSF said it has had no choice but to relocate staff and suspend its operations in Macomia.
Alfane Silva, a father of five, told the BBC he was detained and interrogated by eight gunmen. Again, this is not his real name.
“They were wearing military gear and carried heavy weapons,” he said.
“They told me to run to the bush or they would kill me if I stayed in town.”
Mr Silva said it took two days for government reinforcements to arrive, but by then the militants had already left.
More than 700 people fled this latest round of fighting in Macomia, according to the International Organization for Migration (IOM).
Those who stayed behind, like Mr Silva and Mr Langa, have been left with no medical facilities, no electricity, and live in constant fear of another attack.
It was the latest resurgence of the violence that had declined as security forces, backed by troops from neighbouring states, seemed to be getting the situation under control.
But now, many of those troops are being withdrawn.
The Southern African Development Community (Sadc) mission, made up of about 2,000 soldiers from eight countries, has said it will withdraw its forces from Mozambique by 15 July, and not extend its three-year mandate.
Regional security experts have warned that this may be too early, as the area remains unstable.
Botswana and Lesotho have already pulled their soldiers out, while Angola and Namibia are in the process of leaving.
However, Tanzania, which borders the country to the north, will maintain 300 troops, reports the privately owned Zambeze newspaper, based in the Mozambican capital, Maputo.
Dastan Kweka, a governance specialist in Tanzania, told the BBC that the authorities expect security in the region to deteriorate further.
South Africa, which currently contributes more than 1,000 soldiers to the peacekeeping efforts, has said it will keep its troops in Mozambique until the end of 2024, but not as part of the Sadc mission.
On the other hand, Rwanda, which is not part of Sadc but has supported Mozambique, announced it will send an additional 2,000 troops to the country.
Rwanda army spokesperson Brig-Gen Ronald Rwivanga told the BBC that they were “simply bolstering” their strength. The decision had nothing to do with the Sadc withdrawal or recent attacks, he said.
When Rwanda sent its first 1,000 troops in 2021, it said it was supporting efforts to restore the Mozambican government’s authority in Cabo Delgado.
This followed the signing of several bilateral agreements between the two countries in 2018.
Rwanda’s additional troops will help fill the gaps left by Sadc forces in northern Mozambique.
Meron Elias, an East and Southern Africa analyst for Crisis Group, said the Sadc mission in Mozambique faces financial constraints, relying heavily on member-state contributions to keep it going.
She said the regional bloc has instead shifted its focus towards stabilising the precarious situation in Democratic Republic of Congo.
In December 2023, Sadc sent troops to DR Congo to help the government fight a myriad of rebel groups who are plaguing the east of the country.
The IS-affiliated al-Shabab group in Mozambique – which is not linked to the group with the same name in Somalia – has been active in Cabo Delgado since 2017.
Its insurgents have killed hundreds of people, displaced communities and burnt towns and villages.
They have been fighting for control of the region that is rich in natural gas and minerals such as hydrocarbons, graphite and rubies.
In July 2021, French energy giant Total Energies was forced to suspend its $20bn (£16bn) liquified natural gas project following a shocking attack on the town of Palma.
After the deployment of Sadc and Rwandan troops the same year, aid agencies and the government reported that security had improved in some areas and normal life was gradually returning.
Unfortunately, this progress was short-lived.
Since December 2023 attacks have been on the rise again.
More than 110,000 people have been forced to flee their homes, according to the IOM.
Tomas Queface, a researcher at Mozambique’s Cabo Ligado website that monitors the violence, said the militants succeeded in holding Macomia for two days by recruiting more fighters, including children.
A report by campaign group Human Rights Watch mentioned two people from one family who spotted their 13-year-old nephew looting alongside the jihadists during the attack.
Mozambique’s northern neighbours are eyeing what is happening nervously.
In 2020, the jihadists attacked villages over the border in Tanzania, killing around 25 people, looting shops and burning down homes.
Since then, Tanzania has heightened security by imposing curfews in some border villages, increasing patrols and restricting movement between the two countries.
Mr Kweka said that although this strategy has been successful it has been expensive. Tanzania’s defence budget has increased by 10% each year since 2021.
Meanwhile, there are growing concerns that if the Cabo Delgado insurgency gains further momentum, other neighbouring countries, like Malawi, could be affected if insurgents slip across the border, according to analyst Meron Elias.
She said there was some evidence of regional links developing further between al-Shabab in Mozambique and the Allied Defence Forces, an IS affiliate operating in DR Congo and parts of Uganda – though the level of co-operation is unclear.
Regional security experts say that Mozambique’s armed forces could secure a military victory if they were strengthened further, and this is not the time to be withdrawing foreign troops.
But the only long-term solution is to address the social and economic challenges experienced in the north of the country, where living standards are lower than the south, fuelling complaints of discrimination, which is exploited by the jihadists.