‘In the little moment that remains to us between the crisis and the catastrophe, we may as well drink a glass of champagne,” said Paul Claudel, the French poet, dramatist and ambassador to the United States in the early 1930s. He was downplaying hopes of averting financial disaster, but his words felt like good, if despairing, advice for Ukraine in the past few days as it approached its “champagne moment”.

Catastrophe in the shape of civil war, Russian invasion and partition are not yet inevitable, but they are just around the corner. The deal reached between Russia, US, the European Union and Ukraine on Thursday, whereby protesters in east Ukraine would vacate public buildings they had occupied and give up their arms in return for greater autonomy for pro-Russian districts, has only slowed the momentum towards civil strife. The demonstrators are insisting that they have as much legitimacy as what they call “the Kiev junta” since it came to power through street demonstrations overthrowing a corrupt, incompetent but elected government.

Western media has focused obsessively on how far pro-Russian militiamen in east Ukraine obey orders from the Kremlin, but such attention obscures a more significant feature of the Ukrainian political landscape. Every election in Ukraine since the fall of the Soviet Union in 1991 has shown that the country is almost equally divided between pro-Russians and pro-Westerners with each side capable of winning closely fought elections. Pretending that the revolt in east Ukraine is phony and stage-managed by Russia is dangerous self-deception.

Download the new Independent Premium app Sharing the full story, not just the headlines

Different though Ukraine is from Iraq and Afghanistan there are some ominous similarities in the Western involvement in all three countries. The most important of these common features is that each country is deeply divided and to pretend otherwise is to invite disaster. In 2001, most Afghans were glad to see the back of the Taliban, but the Taliban and the Pashtun community – some 42 per cent of the Afghan population – in which the Taliban are rooted could not be successfully disregarded or marginalised. Creating a government dominated by the old anti-Taliban Northern Alliance leaders automatically destabilised the country.

Much the same happened in Iraq. Under Saddam Hussein and his predecessors, the Sunni community, some 20 per cent of Iraqis, had held the crucial levers of power at the expense of the Shia Arabs and Kurds, four-fifths of the population. The fall of Saddam meant an ethnic and sectarian revolution was inevitable but the US and British belief that the only people angry and dispossessed in Iraq in 2003 were criminalised remnants of the old regime, wholly underestimated the danger of a Sunni revolt.

Tony Blair recently claimed that all would have been well in occupied Iraq if there had not been mischievous interference by outsiders such as Iran and Syria. But sovereign states do not exist in isolation. Occupy them – as happened in Kabul and Baghdad – or become the predominant influence, as the US and EU have been doing in Kiev, and you transform the political geography of a whole region. It was absurdly naïve for US officials to imagine that Pakistan, or more precisely the Pakistan army, would philosophically accept the collapse of its decades-long effort to control Afghanistan after 2001. Likewise in Iraq, Bush administration officials, flushed with victory over Saddam, were happily trumpeting their intention that regime change in Iraq would be followed by ones in Tehran and Damascus. Unsurprisingly, the Iranians and Syrians were consequently determined to make sure the US never stabilised its rule in Iraq.

Shifting Ukraine as a whole from being pro-Russian to anti-Russian is a devastating strategic defeat for Russia that it was never going to accept without reaction. A hostile Ukraine would permanently reduce Russia’s status as a great power and push back its influence to the far east of Europe. Of course, if Ukraine mattered so much to Russia it was unwise for its leaders to rely on President Viktor Yanukovych and his gang of racketeers whose power was to evaporate so swiftly. But it was also self-deceptive and irresponsible for EU and US officials either not to see or not to care about the explosive consequences of backing the takeover of an unelected pro-Western government in Kiev, propelled into office by groups including extreme ultra-nationalists, and then to treat it as if it has total legitimacy.

But it is not Western diplomats and politicians alone who make mistakes. The foreign media has presented an over-simplified picture of what is happening in Ukraine much as it did in Afghanistan, Iraq, Libya and Syria. The old regime in all cases was demonised and its opponents glorified, so the picture of events presented to the public was often close to fantasy.

Much the same is happening in Ukraine. Media focus is all on the credibility or lack of it of the separatists in east Ukraine and very little on the new government in Kiev. In fact, what is most striking about both sides is their almost comic ineffectiveness: Three months ago, Yanukovych acted as if he had the political and military strength to steamroller the opposition only to find himself forced to flee almost alone across the Russian border. Last week Kiev was confidently sending troops to crush “terrorists” and re-establish its authority in the east only to see its troops tamely surrender their vehicles and defect. When government security forces did kill protesters at Mariupol it turned out they belonged to recently formed National Guard units recruited from ultra-nationalist protesters.

A result of this lack of organised support, however deep and real the popular divisions, is that power vacuums develop which are filled by shadowy militias. This is very much the pattern of recent wars in the Middle East. For instance, in Afghanistan what is striking is not the strength of the Taliban, but the weakness and unpopularity of the government. In Iraq the government has 900,000-strong security forces and oil revenues of $100bn (£60bn) a year but for the last three months the Islamic State of Iraq and the Levant, an organisation criticised by al-Qa’ida for its excessive violence, has ruled Fallujah 40 miles west of Baghdad.

Catastrophe in Ukraine can still be avoided by compromise and restraint but the same was true of Afghanistan, Iraq and Syria. A reason why these countries have been torn apart by wars was a false belief by outside powers that they could win cheap victories, and a failure to appreciate that their chosen partner locally was a self-interested faction with many enemies. In Syria for instance, the US and its allies have been claiming for three years that the real representatives of the Syrian people are discredited but well-financed exiles who dare not visit either government or rebel-held areas.

What makes Ukraine so dangerous is that all sides exaggerate their support, underestimate that of their opponents, and then overplay their hands. By accepting as legitimate a government in Kiev installed by direct action, the US and EU irresponsibly destabilised a tract of Europe, something that should have been obvious at the time. To quote Paul Claudel again: “It is fortunate that diplomats have long noses since they usually cannot see beyond them.”