Franklin D Roosevelt is supposed to have said of Anastasio Somoza, the late Nicaraguan dictator: “He may be a son of a bitch, but he’s our son of a bitch.” That broadly sums up the west’s attitude towards Idriss Déby, Chad’s “warrior president”, who was killed on the battlefield this week after 31 years in power.

In a less troubled part of the world, Déby might have been seen for what he was: a brutal dictator and a warlord. The son of a poor herder from Chad’s northern desert lands, he rose through the military after training in France, and seized power in a 1990 coup. Though he began with seemingly good intentions, he crystallised into a hardened strongman. He bought off his rivals, if they were lucky, and enriched his cronies with oil profits.

For three decades, he ran a militarised state in which the armed forces, the best equipped and most professional in the region, sucked up most resources. His country’s 16m people were pretty much left to fend for themselves. Literacy rates are little above 30 per cent and life expectancy is 54 years. The UN’s human development index ranks Chad 187 out of 189. If Déby was a warrior, he was not good at combating human misery.

But Chad does lie in a troubled neighbourhood. A country nearly four times the size of Germany, it straddles the semi-arid Sahel belt at the crossroads of several vicious conflicts. France has 5,000 troops bogged down in the region. They are headquartered in Chad’s capital N’Djamena and are fighting various jihadi groups across the Sahel associated with Isis. Islamists, feeding off a poisonous concoction of poverty, ignorance and local conflicts, have gone on a killing and kidnapping spree, particularly in Mali and Burkina Faso. Tens of thousands of people have died and 2m have been displaced.

Idriss Déby death: Chad map

In such a context, Déby has been regarded by France and the west more generally as an ally. He was a gun for hire and an alternative to sending more troops to a region that has been called France’s Afghanistan.

Under his command, Chad’s army has been more effective than Nigeria’s forces against Boko Haram, the militant Islamist group active in north-east Nigeria. In Mali in 2013, Déby’s army fought alongside France when it ousted Islamists threatening to take over the country. The following year it helped quell fighting in the Central African Republic. In military terms, Chad has been the most effective member of the G5, an alliance with Burkina Faso, Mali, Niger and Mauritania aimed at pushing back the Islamist threat.

A grateful France has returned the favour. Two years ago, French fighter jets bombed a rebel convoy crossing from Libya to protect the Déby regime. This time, it could not save him. But, of his death, Paris effused that it had “lost a brave friend . . . a great soldier and president who laboured ceaselessly for three decades for the security of his country and the stability of the region”. The US state department said it mourned his passing.

These are generous words for a man who presided over a fearsome security apparatus that suppressed all opposition. As Helga Dickow, senior researcher at the University of Freiburg, writes: “Political liberties are almost non-existent; human rights violations are part of everyday life, and opposition leaders, human rights activists, journalists and trade unionists live under permanent threat.”

Following his death, Chad risks a period of chaos. Several factions oppose the passage of power to Déby’s 37-year-old son, Mahamat Idriss Déby, and are pressing for elections. The west’s instinct is to stick with what it knows. But answers to the Sahel’s Islamist threat lie in development, opportunity and institutions. Little long-term good is likely to come from a warrior dynasty with no legitimacy beyond the gun.