AT THE weekly market in Toya, at the edge of the Niger river, just outside the ancient city of Timbuktu, little seems to have changed. Under shelters built from branches and tarpaulins, traders in turbans with leathery faces hawk almost everything imaginable. There are slabs of rock salt, mined deep in the desert, next to crates of Algerian cigarettes. Cheap radios sit beside tins of USAID vegetable oil (the marking “not for sale” roundly ignored).

Yet all is not well here. A group of armed UN peacekeepers walks among the shoppers, asking questions. One elderly Tuareg says that just a few days earlier a dozen armed men had wandered into the village, flaunting their weapons. He will not say who they were, but they were not soldiers from the Malian army. “We have fear here. When these men can come and go as they please, there is no security,” he says. When asked if he had ever seen the state’s security forces, he gestures a hand with a large silver ring at the market: “They are never here.”

During the past decade Mali has become one of Africa’s most intractable security problems. Once seen as a model democracy, it has been plagued by violence since 2012, when Tuareg-led jihadists with links to al-Qaeda led a rebellion across northern Mali, at the edge of the Sahara desert (see map). At one time tourists used to pour into Timbuktu to ride camels across the desert. Now most of the foreigners at the airport wear army uniforms. The city has said goodbye to Bono, a rock musician who once played there. But in most other respects things have got worse.

The old fracture lines of race and tribe widened after independence in 1960. Many among the Tuareg and Arab minorities were uncomfortable with being ruled by black Africans in the south. Big rebellions broke out in 1963 and 1990. But the one in 2012, which came after soldiers had staged a coup in Bamako, the capital, marked a turning-point. The rebels, who had developed from a secular nationalist movement into an Islamist insurgency, seemed ready to march on the capital. That prompted France to send in troops, who pushed the rebels out of most cities but did not defeat them entirely. In 2015 the warring parties signed a peace deal. But since then the violence has continued to escalate. At least four separate attacks between January 25th and 28th killed scores of people. Last year the UN counted 220 attacks on its operations. That is more than in 2015 and 2016 combined. The peacekeeping mission established in 2013, known as MINUSMA, is by far the UN’s most dangerous. It has a force of about 11,000, but 150 peacekeepers have been killed. Insecurity has spread from the north to the centre of Mali. The country’s vast desert is not only a breeding ground for jihadism; it is also a trade route that carries consumer goods south and drugs and migrants towards Europe. That partly explains why France’s president, Emmanuel Macron, has already visited Mali twice. France has some 3,000 troops in the Sahel fighting terrorists, most of whom are in Mali. America has a force there too, as does the European Union (on a training mission). Western countries are also paying for a counterterrorism force drawn from regional armies, the G5 Sahel. In Kano, a village 60km east of Timbuktu, the UN shows off what its DDR (disarmament, demobilisation and rehabilitation) programme has achieved. As women in bright wraps and headscarves ululate, a newly built water tower is ceremoniously untapped and brown liquid gushes out onto the sand. “It is an excellent thing,” enthuses Mohammed Ahmed Cissé, the village’s portly chief. “We can grow gardens, and…work together instead of fighting.”

Although the fighting has died down, there is not much disarmament. Armed rebels still live in the village, admits Mr Cissé. And a bigger problem is apparent. No one from the Malian government has been seen in almost a decade. Andrew Lebovich, a Bamako-based analyst from the European Council on Foreign Relations, a think-tank, argues that the government has little interest in implementing the peace agreement. Fully 90% of Mali’s population is in the south, as is most of the economy, which is dominated by goldmining.

A presidential election is due to be held this year and is occupying the incumbent, Ibrahim Boubacar Keïta, far more than insecurity. Mr Keïta has faced protests, but not chiefly over the war: corruption allegations sting more. When the Malian army, which is recruited almost entirely in the south, does try to fight, it is often brutal, which helps armed groups recruit.

As long as the state remains so ineffective, Western countries find themselves pushing on a string. According to one report by the International Crisis Group, an NGO based in Brussels, G5 Sahel soldiers “are spending longer in training and preparatory missions than in doing their actual jobs”. Yet without systematic change, Mali’s problems are only likely to get worse. Half of the population is under the age of 16. The average Malian woman has six children. According to Unicef, barely a third of the population can read, a sad statistic that is unlikely to improve soon, given that hundreds of schools have been closed because of the fighting. Young men without much education or chance of employment are easy recruits to jihadism.

In Timbuktu Mohammed Ag Atta, a 52-year-old Tuareg, says that a decade ago he made good money guiding tourists out into the desert. But now he cannot even feed his camels. “The problem is the state,” he says. “Nobody notices us.” And so the war goes on.

Correction (February 3rd, 2018): An earlier version of this article misquoted Mr Lebovich. The article has been amended to clarify that his point was specific to the government of Mali's commitment to the 2015 peace agreement, rather than to security in general. Sorry.