The shadowy figures of Kurdish fighters can be just made out on film as they ambush and kill three pro-Turkish fighters in a night time attack in Afrin in northern Syria. The Kurdish enclave was invaded and occupied by the Turkish army and their Syrian armed opposition allies earlier in the year. Sporadic guerrilla warfare has been going on ever since.

This skirmish took place a few days after an attack on a military parade by gunmen a thousand miles away from Afrin in Ahvaz in southwest Iran that killed 25 people. Film shows soldiers and civilians running in panic as they are sprayed with bullets, leaving 25 dead, including 11 conscripts and a four-year-old child. The killings were claimed by both Isis and Arab separatists from the province of Khuzestan whom the Iranians accused of acting as catspaws for the US, Saudi Arabia and the UAE.

These incidents matter because they may be the harbinger of the next round of confrontations, crises and wars engulfing the Middle East. The most recent phase of conflict in the region saw the rise and fall of Isis and failed campaigns to overthrow the governments of Syria and Iraq. But Isis, which three years ago ruled a de facto state with a population of five or six million, has been largely crushed and confined to desert hideouts. President Bashar al-Assad – whose fall was confidently predicted after the uprising in 2011 – is firmly in power, as is the Iraqi government that suffered calamitous defeats at the time of the Isis capture of Mosul in 2014.

But the round of conflicts just ending may soon be replaced by another with different players and different issues. The guerrilla action in Afrin is a single episode in the escalating confrontation between Turkey and the Kurds in northern Syria which will involve the US and Russia. The Middle East is always dangerous because, like the Balkans before 1914, it is full of complex but ferocious conflicts that draw in the great powers. The risk is always there but is more dangerous under President Trump because he and his administration view the Middle East through a paranoid prism in which they everywhere see the hidden hand of Iran. President George W Bush and Tony Blair had similar tunnel vision during the invasion of Iraq in 2003 when they blamed everything that went wrong on a remnant of Saddam Hussein supporters.

The exaggeration of “the Iranian threat” by the Trump administration this week at the UN General Assembly in New York was very like what was being said about Iraq fifteen years earlier. The National Security Advisor John Bolton threatened that “the murderous regime and its supporters will face significant consequences if they do not change their behaviour. We are watching, and we will come after you.” The US military intervention in Syria, previously targeting Isis, will in future be directed against Iranian influence.

US policy in Syria and Iraq has been likened to playing chess while mistaking the knight for the bishop and thinking that castles move diagonally. The US has decided to retain a military force in northeast Syria in order to thwart Iranian ambitions, but the country most affected by this is not Iran but Turkey. The US can only stay in this part of Syria in alliance with the Syrian Kurds, whose de facto state, which they call Rojava, Turkey is pledged to eliminate.

Turkey has been nibbling its way into northern Syria over the past two years and is now deploying troops in Idlib province in cooperation with the Russians. A shaky alliance with Turkey as a leading Nato military power is one of the biggest Russian gains of its military intervention in Syria which it will go a long way to preserve. President Recep Tayyip Erdogan is now threatening to extend the Turkey advance east of the Euphrates river in order to slice up the Kurdish statelet.

Iran parliament reacts after Trump's withdrawal from nuclear deal Show all 10 1 /10 Iran parliament reacts after Trump's withdrawal from nuclear deal Iran parliament reacts after Trump's withdrawal from nuclear deal Iranian MPs burnt a US flag in parliament after Donald Trump announced America's withdrawal from the nuclear deal. AFP/Islamic Consultative Assembly News Agency Iran parliament reacts after Trump's withdrawal from nuclear deal US President Donald Trump displays a presidential memorandum after announcing his intent to withdraw from the JCPOA Iran nuclear agreement in the Diplomatic Room at the White House. Reuters Iran parliament reacts after Trump's withdrawal from nuclear deal Some Iranian MPs reacted after Trumps decision by shouting 'death to America'. AFP/Islamic Consultative Assembly News Agency Iran parliament reacts after Trump's withdrawal from nuclear deal Iranian lawmakers prepare to burn two pieces of papers representing the US flag and the nuclear deal. AP Iran parliament reacts after Trump's withdrawal from nuclear deal Iran said it will hold talks with signatories to the nuclear deal after Trump's decision to withdraw from the accord, which it branded "psychological warfare". AFP/Islamic Consultative Assembly News Agency Iran parliament reacts after Trump's withdrawal from nuclear deal Several Iranian MPs stood chanting in the Tehran parliament. AFP/Islamic Consultative Assembly News Agency Iran parliament reacts after Trump's withdrawal from nuclear deal Iranian MPs burning a US flag AFP/Islamic Consultative Assembly News Agency Iran parliament reacts after Trump's withdrawal from nuclear deal President Hassan Rouhani addressed the nation in a televised speech in Tehran. He said he'd send his foreign minister to negotiate with countries remaining in the nuclear deal after Trump's decision to pull America from the deal, warning he otherwise would restart enriching uranium "in the next weeks." Iranian Presidency Office via AP Iran parliament reacts after Trump's withdrawal from nuclear deal Iran's press condemned Trump's withdrawal from a multi-party nuclear deal but was divided over whether Tehran should react with patience or withdraw itself. AFP Iran parliament reacts after Trump's withdrawal from nuclear deal Trump announced the US withdrawal from what he called the "defective" multinational nuclear deal with Iran, and said Washington would reinstate sanctions against the Islamic republic. AFP/Getty

This would mean the extinction of the last remaining gain of the Syrian uprising of 2011. Rojava was the unexpected creation of the Syrian Kurds and their YPG militia that allied themselves with the US against Isis during the siege of Kurdish city of Kobani in 2014. They provide the ground troops and the US the airpower.

The US-backed Kurds are greatly overextended, holding a swathe of northeast Syria, half of whose population are Arabs hostile to Kurdish rule. It is not a place where American troops can stay forever without becoming somebody’s target. Prolonged US presence invites disaster as with the American ground operations in Lebanon in 1982-84, Somalia in 1992-95 and in Iraq in 2003-11. “There will always be people in the Middle East who think that the best way to get rid of the Americans is to kill some of them,” noted one observer with long experience of region.

Denunciations of Iran as the root of all evil by Trump, Bolton, Secretary of State Mike Pompeo and UN ambassador Nikki Haley are simple minded to the point of idiocy. Haley responded to the Ahvaz massacre by telling the government to “look in the mirror”. Bolton last year promised the exiled Iranian opposition group, the very weird cult-like Mojahedin-e Khalq, that by 2019 they would be ruling Iran. This week he was saying that there would be “hell to pay” if Iran stood in the way of the US.

The blood-curdling rhetoric may be arrogant and puerile but should be taken seriously because it reflects the same attitude of mind that preceded past US interventions in the Middle East: the enemy is demonised and underestimated at the same time. There is credulity towards self-interested exiled groups who claimed that US intervention would be easy (Iraqi opposition groups were privately cynical in 2003 about how far they were misleading the Americans on this score). Israel, Saudi Arabia and UAE have an interest in luring the US into fighting Iran, though they are not intending to do much fighting themselves.

The twists and turns of US policy in the Middle East has in the past mystified knowledgeable observers who attribute bizarre actions by the White House to stupidity and ignorance of local conditions. But US policy was often more rational than it looked – so long as one understood that it was determined by American domestic politics and the main purpose was to persuade the US voter, particularly in the run up to important elections, that their president had not mired them in a bloody and unsuccessful war.