Haruna Hasaman knew she only had moments to get away when the roar of motorbikes ruptured the quiet of her village in Zamfara state, northwest Nigeria.

She scrambled for her five children and fled just as the gunmen screeched in and opened fire.

"They killed many of the men," including her brothers and nephews, she said.

Now more than eight months later, Hasaman and her children are among several thousand displaced people living in tents in the town of Anka.

The attack on her village was just one in a broader conflict that has seen gangs of Kalashnikov-wielding "bandits" terrorise remote communities for years in this impoverished region.

"Even as we were running they were shooting. We will never go back," she said.

A farewell to arms? The Yansakai vigilante group surrendered hundreds of weapons last month
A farewell to arms? The Yansakai vigilante group surrendered hundreds of weapons last month AFP / Kola Sulaimon

Authorities say more than a thousand people lost their lives over the last year. In September, the UN said 40,000 people had fled to neighbouring Niger.

Nigeria's central government tried responding with force, launching a string of military operations that involved airstrikes on bandit hideouts.

But this failed to quell the violence -- and when a new regional governor took office last year, there came a shift to negotiations.

In September, Zamfara's government brokered a controversial peace deal to halt the spiral of violence between bandits and armed vigilante groups opposing them.

For now, a fragile truce appears to be holding and the attacks have ebbed.

"We had to do something," Zamfara state security advisor Ababukar Daura told AFP.

A sick child is weighed on makeshift scales at a Doctors Without Borders (MSF) clinic in Anka
A sick child is weighed on makeshift scales at a Doctors Without Borders (MSF) clinic in Anka AFP / Kola Sulaimon

Unpicking the deep grievances, economic hardships and a proliferation of weapons that have fuelled the conflict is complex.

The violence in Zamfara -- where most of the four-million population live in remote villages -- began as armed robbery and cattle rustling more than a decade ago, then spiralled as clashes over land and resources intensified between ethnic Fulani herders and local farmers.

Eventually, it emerged into an insurgency of heavily armed and mainly Fulani assailants, dubbed "bandits".

Exploiting a security vacuum, they launched attacks from forest hideouts, raiding, killing and kidnapping for ransom.

The delicate peace is bringing some change.

In his office, Zamfara advisor Daura showed off dozens of Kalashnikov rifles he said were among 2,000 guns handed in under an amnesty since the deal was struck.

A member of the Yansakai vigilante group
A member of the Yansakai vigilante group AFP / Kola Sulaimon

There are few details on what the bandits and vigilantes have been offered. Some fear the latest accord could unravel like previous agreements.

Some in neighbouring regions already complain of an increase in violence, claiming the problem has simply been pushed elsewhere.

Daura insists Zamfara's authorities were "not paying any bandit" but were instead looking to offer job opportunities in a region where unemployment is rife.

Yet bandits and vigilantes told AFP that promises of both money and jobs have been made to them -- and both sides admit they still retain weapons.

Until a few months ago 44-year-old Hassan Dantawaye was a wanted man.

More than 3,000 displaced people have taken refuge in a camp at Anka
More than 3,000 displaced people have taken refuge in a camp at Anka AFP / Kola Sulaimon

Camped in dense forests, for eight years he led a force of over 1,000 armed bandits. Now he is back home.

"Before the peace agreement, you would never see me here," Dantawaye told AFP.

"Since the government's intervention, we thank God, we can move freely," he said.

"We can stop the killing. We are former bandits now, for peace."

Dantawaye described a campaign of attacks but insisted he only took up arms after hundreds of his Fulani kinsmen were killed.

"What should we do, wait for them to keep attacking us?" he asked.

Initially, to resource their fight they traded livestock for weapons with gunrunners in Niger.

On the other side of the conflict are the Yansakai, local vigilantes who say they emerged to beat back the Fulani.

Previous authorities used to pay them to fight the "bandits" but the group has also been accused of widespread abuses.

At a ceremony last month before regional governor Bello Matawale, hundreds of the fighters unloaded sacks of Kalashnikovs and locally made hunting rifles as part of their promise to disarm.

"We have given over 500 weapons," Sani Muhammed, a Yansakai leader, told AFP.

"If there is peace, why would we have arms?"

The new regional government stopped the monthly payments worth some $40 (37 euros), but fighters say they were promised cash handouts, jobs and an amnesty for petty crimes during negotiations.

And for now they are still keeping hold of some guns.

"We have many, many more weapons," Muhammed said.

"If the bandits give their weapons, and keep their promise to end the killings, we will give the government our weapons too."

Zamfara's authorities say the state has returned to peace.

Yet for thousands, still living in camps like in Anka, the situation remains bleak.

A clinic run by Doctors Without Borders (MSF) treats those in the camp and staff say the violence has exacerbated poverty and malnutrition in the region.

"What people are experiencing is really like being thrown from the frying pan into the fire," Philip Aruna, Nigeria country director at MSF, told AFP.

Few in the camp expect peace to last.

Sheltering from the sun, dozens of the displaced revealed pictures from their phones, sent from the towns they fled.

They said they showed that armed bandits remain a constant presence, roving villages, demanding cattle and food and committing sexual abuses.

"They are still in the bush," said Rahima Garba, 26. "In our villages, terrorising us."