As Harold Macmillan said to Alec Douglas-Home in 1963 when he handed over his office at 10 Downing Street: “Our country is doing very well. And, as long as you don’t invade Afghanistan, you’ll be just fine too. Advice that John Major probably did not pass on to Tony Blair.

And yet, the first three British defeats in Afghanistan should have alerted him: as the Scottish historian William Dalrymple explains in his book (Return of a King: the Battle for Afghanistan 1839-42), the fourth Anglo-Afghan war, which began in 2001, is an extraordinary replay of the first one, which began in 1839: for example, the Afghan president from 2004 to 2014, Hamid Karzai, was from the same Popalzai sub-tribe as the puppet the British had installed in 1839, Shah Shuja ul-Mulk. And Mohammad Shah Khan, the military leader who led the extermination of the British army in 1841 was heir to the same dynasty (the Hotaki, leaders of the Ghilzai, one of the components of the Pashtun people) as the main leader of the Taliban, Mullah Omar, assassinated in 2013.

By choosing leaders without knowing the reality of a civilisation and a history, by claiming to impose a democracy through corrupt leaders and an external army, it was clear that the Western coalition had no more chance than it did a hundred and fifty years ago to install a lasting and legitimate democracy in this country.

This is not the first country to experience this: in the past, there have been other failures in the transition to a sustainable democracy of dictatorships, or of colonised or invaded countries, such as Algeria, Egypt, Russia or Iraq, among many others.

There have also been success stories: democracies have become established after periods of dictatorship (Spain, Chile, Albania, parts of the former Yugoslavia); others after an occupation by a foreign power (Germany, Austria, Italy, Eastern European countries, Japan, Korea); others after a period of colonisation (India, Nigeria, Ivory Coast, Senegal, Ghana, and others in Africa and Latin America), sometimes long after the colonisers had left.

And today? Many countries are threatened to fall back into dictatorship, or not to come out of it, if the West withdraws its support: What will happen to Mali, if the French army withdraws? What will happen to Taiwan if the US army removes its shield? To Lebanon, if the much hoped-for aid does not arrive? And even in India, whose democracy seems to be faltering, as Hungary’s and Poland’s are becoming more and more so.

What can be done to avoid these disasters? How can we learn a constructive lesson from the Afghan disaster?

Past examples show that a country cannot make a lasting transition to democracy by having it imposed from above by foreign forces, without taking into account its history, its cultural diversity, the existence of a national feeling, a civil society, a desire to live together, a powerful group determined to fight to maintain it; and without real liberation of women and young people from the dictatorship of patriarchy.

Secondly, it is clear that it is easier to become a democracy when one’s neighbours are already democracies; hence the democratic successes, however fragile, in Eastern Europe, Latin America and parts of Africa. And others, more difficult, in countries like Armenia.

Secondly, a democracy cannot be built unless education, women’s rights, the honest participation of all in public decision-making and the fight against corruption and nepotism are given absolute priority.

Secondly, when international aid is not conditional on a move towards democracy and human rights, which almost no donor country and no international financial institution does (with the exception of the OECD, which does a competent and discreet job of training and advising, even for countries that are not members).

Finally, when democracy proves incapable of managing long-term issues, indulging in petty political debates. At that point, all democracies, even our own, are threatened…