ALMOST a century ago, as war raged in Flanders, Britain took the fateful decision to carve up the Ottoman empire. It wanted to stop Russia and others from gaining influence over Islam that could be used to inflame Muslims in British possessions from Egypt to India. Working with France, Britain set up monarchies and protectorates, forging nations out of the tribes and sects that littered the Ottoman provinces. After independence this imperial construction continued to be imposed by despots and dictators. Today it is falling apart (see article). At its heart, in Iraq, a Sunni rebellion is boiling. In the past ten days the jihadists of the Islamic State of Iraq and Greater Syria (ISIS) in league with large numbers of ex-Baathists and Sunni militias have taken the second city, Mosul, and swarmed to within striking distance of the capital. Shia-dominated Baghdad is unlikely to fall, but a stand-off beckons in which large parts of Iraq remain in rebel hands and the Kurdish north drifts towards independence. At the same time, Syria is engulfed by civil war, split between a western part under Bashar Assad and an eastern jumble of fiefs and territories under the Kurds and rival Sunni militias. Earlier this month ISIS took a symbolic step towards creating a new Islamic state by bulldozing a berm on the line drawn by French and British diplomats to divide Syria from Iraq all those years ago.

For the outside world the litany of beheadings, massacres and sectarian hatred raises two questions. Is the old order salvageable in Iraq and Syria? And, if so, is it worth saving?

Tribes with black flags

Across the Middle East, post-imperial despotism has collided with a religious rejection of modernity and an angry youth bereft of opportunities. In Iraq the conflict is especially poisonous because of the invasion in 2003—a fact that its architects, including Britain’s former prime minister, Tony Blair, do themselves no service by denying. The invasion was supposed to replace a dictatorship with a resilient democracy. Instead it implanted al-Qaeda and its foreign jihadists, brutalised the people with years of suicide-bombings, sectarian hatred and insurgency, and paralysed the West’s will to intervene constructively even when there are strong arguments to do so.

What is more, Nuri al-Maliki, the Shia prime minister who eventually emerged, has governed Iraq disastrously. Fearful of a Sunni resurgence and of challenges to his own power, he strangled the institutions of Iraqi democracy in the cradle. Competent army officers were a threat, so he replaced them. Low-level Sunni resistance helped unite his own Shia community behind him, so he repressed Sunnis and excluded them from government. Corruption yielded funds to buy off opponents and reward cronies, so graft flourished.

Many people will now calculate that they can profit from the Sunni rebellion. Iraq’s Kurds have seized full control of disputed, oil-rich Kirkuk. Mr Assad can revel in the seeming proof that the people he is fighting in Syria are both monstrously cruel and the sworn enemies of the West. Iran, which craves regional influence, is needed more than ever by Mr Maliki, a resentful fellow Shia, and it hopes that America may call on it to help repel ISIS. The Arab monarchies wish that Sunni rebels might bleed their rival, Iran, which is short of money and already fighting alongside Mr Assad in Syria. Even Mr Maliki might fancy his chances of tightening his grip on Iraq’s Shia majority—and eventually taking back most of his country.

The one thing that favours Iraq remaining intact is that ISIS’s brand of fanatical Islam and its mission to export jihad threaten everybody. Crucially, that includes the Sunni rebels. Today ISIS conveniently offers them deliverance from Mr Maliki; tomorrow it threatens to impose its own brutal version of Islamic rule. Sunni militias are already fighting ISIS in Syria. Sunni Iraqis fought against its al-Qaeda forerunner once before, during the Sahwa, or Awakening, in 2007-08, thanks to American money and the promise of a stake in the new Iraq. They are allies of ISIS today because that promise was not honoured. For Iraq to remain in one piece the Sunnis must be persuaded to try again, under the assurance that this time Iraq really will be a federal state in which power is shared in Baghdad and institutions like the army regain their national character.

The sectarian Mr Maliki is not the man to win the Sunnis over. Ideally his Iranian backers would force him to give way to a new prime minister. Similarly the Arab monarchies might lean on Iraqi Sunnis to reject ISIS, and the Turks might make clear to the Kurds that they should not rush towards independence, but also give federalism a chance.

America can help with the Kurds, but its role should chiefly be to knock diplomatic heads together so as to prise Iraqi Sunnis from ISIS by encouraging a temporary convergence of regional interests. America should be in no hurry to deploy aircraft and drones—for fear of widening the very sectarian divide that it wants to narrow. The time for military action may come later, if Baghdad is imperilled or ISIS threatens to spread global terror from its jihadist camps. As part of the campaign against ISIS, America should accelerate and augment its policy of training and arming more moderate Syrian forces. That would, incidentally, strengthen the rebellion against Mr Assad, who has all along cynically fomented jihadism in order to make himself appear the lesser of two evils.

Worth fighting for

Winning over Iraqi Sunnis and corralling regional rivals will not be easy. But it is worth trying. The Middle East’s imperial boundaries are flawed—but so is every other plausible set of lines. The break-up of the Balkans showed how much blood is spilled when people redraw their borders using force. In Iraq and Syria the process could take years—and would feed sectarianism and global terrorism. It might spread to other countries, such as Lebanon and Jordan, created by the same imperial geographers. And when at last peace comes, it will inevitably require an acceptance that people have more to gain from accommodation than from shutting each other out. Better on balance to aim for that now, within today’s flawed borders, than to sit back and watch Iraq go up in flames.