The Syrian peace talks between government and opposition will begin in the next few days in Geneva in an atmosphere of almost undiluted gloom about the prospects for success. The two sides hate each other and have spent five years trying to kill each other, making it unlikely that they will agree to share power in any way except geographically, with each side keeping the territory it currently holds and defending it with its own armed forces.

This pessimism is difficult to contradict, given that several of the most powerful groups doing the shooting will not be present in Geneva. Neither Isis nor the al-Nusra Front are invited, not that it was ever likely that they would turn up even if they were. There are disputes about who exactly is a terrorist, with Saudi Arabia pushing the Army of Islam that controls the rebel stronghold on the eastern side of Damascus and Turkey insisting on the exclusion of the Syrian Kurds, America’s most effective ally against Isis.

The problem about ending the war in Syria and Iraq is that there is a multitude of players who are too strong to lose but too weak to win. Countries and movements such as Iran and Hezbollah see themselves as fighting for their very existence in a war they cannot afford to lose. Others, like Saudi Arabia and Turkey have invested too much credibility in the struggle for Syria to admit they are not going to achieve their aim of ousting President Bashar al-Assad.

Syria: Homs lies in ruins after years of urban warfare

Wars sometimes end by exhaustion rather than agreement, and that may be the best that can be expected for Syria. Local ceasefires and armed truces would be put in place, like the 600 or more that periodically interrupted the 15-year civil war in Lebanon. The difficulty here is that cult-like movements such as Isis and al-Nusra exist to fight for and live up to their Islamic faith by fighting what they see as demonic enemies. They are not like the Lebanese warlords who used to occasionally find it in their mutual interests to stop trying to kill each other.

But, while we may not see many positives emerge from the talks in Geneva, the political landscape in the region is a little more conducive to peace than previously. The Russian military intervention four months ago means that Assad is not going to lose, though he is unlikely to win decisively. He remains in power but only because of the increased support from Iran, Russia and Hezbollah in Lebanon and, even with their backing, his army has not recaptured cities he lost last year, such as Palmyra and Idlib. President Assad may not want to talk in Geneva, or subsequently, but he is more than ever dependent on these external allies who do not want to be mired in an endless Syrian civil war.

Winners and losers are beginning to emerge in Syria, though not all of those involved can see this. Isis is looking increasingly battered by a medley of enemies backed by the US and Russian air forces, though it is nowhere near defeat. The US keeps trumpeting its loss of Ramadi, in Iraq, but the Iraqi special forces that took over the ruined city number only about 500 soldiers. The Iraqi Kurdish peshmerga who recaptured Sinjar have not been paid for five months, because the Kurdistan Regional Government is bankrupt. The Syrian army is short of men and, while its morale may be higher thanks to the Russians, it is still exhausted by five years of war. The Syrian Kurds are successful, but averse to being used as cannon fodder by the US and they are nervous of Turkish intervention.

In pictures: The rise of Isis Show all 74 1 /74 In pictures: The rise of Isis In pictures: The rise of Isis Isis fighters Fighters of the Islamic State wave the group's flag from a damaged display of a government fighter jet following the battle for the Tabqa air base, in Raqqa, Syria AP In pictures: The rise of Isis Isis fighters Fighters from Islamic State group sit on their tank during a parade in Raqqa, Syria AP In pictures: The rise of Isis Isis fighters Fighters from the Islamic State group pray at the Tabqa air base after capturing it from the Syrian government in Raqqa, Syria AP In pictures: The rise of Isis Isis fighters Fighters from extremist Islamic State group parade in Raqqa, Syria AP In pictures: The rise of Isis Isis kidnapping A video uploaded to social networks shows men in underwear being marched barefoot along a desert road before being allegedly executed by Isis Getty Images In pictures: The rise of Isis Isis kidnapping Haruna Yukawa after his capture by Isis In pictures: The rise of Isis Isis kidnapping Khalinda Sharaf Ajour, a Yazidi, says two of her daughters were captured by Isis militants Washington Post In pictures: The rise of Isis Isis fighters Spokesperson for Isis Vice News via Youtube In pictures: The rise of Isis A pro-Isis leaflet A pro-Isis leaflet handed out on Oxford Street In London Ghaffar Hussain In pictures: The rise of Isis Isis fighters Isis Jihadists burn their passports In pictures: The rise of Isis Isis controls Syrian Aid A man collecting aid administered by Isis in Syria In pictures: The rise of Isis Isis controls Syrian Aid A woman collecting aid administered by Isis in Syria In pictures: The rise of Isis Isis controls Syrian Aid Local civilians queue for aid administered by Isis. Since it declared a caliphate the group has increasingly been delivering services such as healthcare, and distributing aid and free fuel In pictures: The rise of Isis Iraq crisis Iraqi security forces detain men suspected of being militants of the Isis group in Diyala province In pictures: The rise of Isis Iraq crisis Mourners carry the coffin of a Shi'ite volunteer from the brigades of peace, who joined the Iraqi army and was killed during clashes with militants of the Isis group in Samarra, during his funeral in Najaf In pictures: The rise of Isis Iraqi refugees An Iraqi Shiite Turkmen family fleeing the violence in the Iraqi city of Tal Afar, west of Mosul, arrives at a refugee camp on the outskirts of Arbil, in Iraq's Kurdistan region In pictures: The rise of Isis Isis leader Abu Bakr al-Baghdadi A photograph made from a video by the jihadist affiliated group Furqan Media via their twitter account allegedly showing Isis leader Abu Bakr al-Baghdadi delivering a sermon during Friday prayers at a mosque in Mosul. Abu Bakr al-Baghdadi declared an Islamist caliphate in the territory under the group's control in Iraq and Syria In pictures: The rise of Isis Islamic extremists destroying mosques in Iraq Shiite's Al-Qubba Husseiniya mosque explodes in Mosul In pictures: The rise of Isis Islamic extremists destroying mosques in Iraq Smoke and debris go up in the air as Shiite's Al-Qubba Husseiniya mosque explodes in Mosul. Images posted online show that Islamic extremists have destroyed at least 10 ancient shrines and Shiite mosques in territory - the city of Mosul and the town of Tal Afar - they have seized in northern Iraq in recent weeks In pictures: The rise of Isis Islamic extremists destroying mosques in Iraq A bulldozer destroys Sunni's Ahmed al-Rifai shrine and tomb in Mahlabiya district outside of Tal Afar In pictures: The rise of Isis Iraq crisis Iraqi security forces celebrate after clashes with followers of Shiite cleric Mahmoud al-Sarkhi, in front of his home in the Shiite holy city of Karbala, 50 miles (80 kilometers) south of Baghdad In pictures: The rise of Isis Iraq crisis Iraqi security forces arrest a follower of Shiite cleric Mahmoud al-Sarkhi after clashes with his followers in the Shiite holy city of Karbala, 50 miles (80 kilometers) south of Baghdad In pictures: The rise of Isis Iraq crisis Iraqi security forces arrest a follower of Shiite cleric Mahmoud al-Sarkhi at his home after clashes with his followers in the Shiite holy city of Karbala, 50 miles (80 kilometers) south of Baghdad In pictures: The rise of Isis Iraq crisis Iraqi security forces arrest a follower of Shiite cleric Mahmoud al-Sarkhi after clashes with his followers in the Shiite holy city of Karbala, 50 miles (80 kilometers) south of Baghdad In pictures: The rise of Isis Iraq crisis A vehicle burns in front of a home of a follower of Shiite cleric Mahmoud al-Sarkhi after clashes with his followers in the Shiite holy city of Karbala, 50 miles (80 kilometers) south of Baghdad In pictures: The rise of Isis Iraqi refugees An Iraqi woman holds her exhausted son as over 1000 Iraqis who have fled fighting in and around the city of Mosul and Tal Afar wait at a Kurdish checkpoint in the hopes of entering a temporary displacement camp in Khazair In pictures: The rise of Isis Iraqi refugees Displaced Iraqi women hold pots as they queue to receive food during the first day of the Islamic holy month of Ramadan, at an encampment for displaced Iraqis who fled from Mosul and other towns, in the Khazer area outside Irbil, north Iraq In pictures: The rise of Isis Isis fighters in Syria A militant Islamist fighter waving a flag, cheers as he takes part in a military parade along the streets of Syria's northern Raqqa. The fighters held the parade to celebrate their declaration of an Islamic "caliphate" after the group captured territory in neighbouring Iraq In pictures: The rise of Isis Isis fighters in Syria Isis fighters wave flags as they take part in a military parade along the streets of Syria's northern Raqqa province Reuters In pictures: The rise of Isis Isis fighters in Syria Isis fighters travel in a vehicle as they take part in a military parade along the streets of Syria's northern Raqqa province In pictures: The rise of Isis Isis fighters in Syria Fighters from the Isis group during a parade with a missile in Raqqa, Syria. Militants from an al-Qaida splinter group held a military parade in their stronghold in northeastern Syria, displaying U.S.-made Humvees, heavy machine guns, and missiles captured from the Iraqi army for the first time since taking over large parts of the Iraq-Syria border In pictures: The rise of Isis Isis fighters in Syria Isis fighters during a parade in Raqqa, Syria In pictures: The rise of Isis Isis fighters in Syria Fighters from the Isis group during a parade in Raqqa, Syria. Militants from the splinter group held a military parade in their stronghold in northeastern Syria, displaying U.S.-made Humvees, heavy machine guns, and missiles captured from the Iraqi army for the first time since taking over large parts of the Iraq-Syria border In pictures: The rise of Isis Isis fighters in Syria Isis fighters hold a military parade in their stronghold in northeastern Syria In pictures: The rise of Isis Isis fighters in Syria Isis fighters during a parade in Raqqa, Syria In pictures: The rise of Isis Isis fighters in Syria A member loyal to the Isis waves an Isis flag in Raqqa In pictures: The rise of Isis Iraq crisis Iraqi anti-government gunmen from Sunni tribes in the western Anbar province march during a protest in Ramadi, west of Baghdad. The United Nations warned that Iraq is at a "crossroads" and appealed for restraint, as a bloody four-day wave of violence killed 195 people. The violence is the deadliest so far linked to demonstrations that broke out in Sunni areas of the Shiite-majority country more than four months ago, raising fears of a return to all-out sectarian conflict In pictures: The rise of Isis Iraq crisis Iraqi security forces hold up a flag of the Isis group they captured during an operation to regain control of Dallah Abbas north of Baqouba, the capital of Iraq's Diyala province, 35 miles (60 kilometers) northeast of Baghdad In pictures: The rise of Isis Isis fighters in Iraq Isis fighters parade in the northern city of Mosul In pictures: The rise of Isis Iraq crisis Volunteers, who have joined the Iraqi army to fight against the predominantly Sunni militants from the radical Isis group, demonstrate their skills during a graduation ceremony after completing their field training in Najaf In pictures: The rise of Isis Iraq crisis Kurdish Peshmerga troops fire a cannon during clashes with militants of the Isis group in Jalawla, Diyala province In pictures: The rise of Isis Lieutenant General Qassem Atta speaks during a press conference Iraqi Prime Minister's security spokesman, Lieutenant General Qassem Atta speaks during a press conference about the latest military development in Iraq, in the capital Baghdad. Iraqi forces pressed a campaign to retake militant-held Tikrit, clashing with jihadist-led Sunni militants nearby and pounding positions inside the city with air strikes in their biggest counter-offensive so far In pictures: The rise of Isis A police station building destroyed by Isis fighters An exterior view of a police station building destroyed by gunmen in Mosul city, northern Iraq. Iraq's new parliament is expected to convene to start the process of setting up a new government, despite deepening political rifts and an ongoing Islamist-led insurgency. Iraqi President Jalal Talabani issued a decree inviting the new House of Representatives to meet and form a new government In pictures: The rise of Isis Isis fighters in Iraq Smoke billows from an area controlled by the Isis between the Iraqi towns of Naojul and Tuz Khurmatu, both located north of the capital Baghdad, as Iraqi Kurdish Peshmerga forces take part in an operation to repel the Sunni militants In pictures: The rise of Isis Iraqi refugees An elderly Iraqi woman is helped into a temporary displacement camp for Iraqis caught-up in the fighting in and around the city of Mosul in Khazair In pictures: The rise of Isis Iraqi refugees An Iraqi Christian woman fleeing the violence in the village of Qaraqush, about 30 kms east of the northern province of Nineveh, cries upon her arrival at a community center in the Kurdish city of Arbil in Iraq's autonomous Kurdistan region In pictures: The rise of Isis Iraqi refugees An Iraqi woman, who fled with her family from the northern city of Mosul, prays with a copy of the Quran AP In pictures: The rise of Isis Isis fighters in Iraq The body of an Isis militant killed during clashes with Iraqi security forces on the outskirts of the city of Samarra Reuters In pictures: The rise of Isis Iraq crisis Iraqi civilians inspect the damage at a market after an air strike by the Iraqi army in central Mosul EPA In pictures: The rise of Isis Iraq crisis Members of the Al-Abbas brigades, who volunteered to protect the Shiite Muslim holy sites in Karbala against Sunni militants fighting the Baghdad government, parade in the streets of the city AP In pictures: The rise of Isis Iraq crisis Shia tribesmen gather in Baghdad to take up arms against Sunni insurgents marching on the capital. Thousands have volunteered to bolster defences AFP/Getty In pictures: The rise of Isis Iraq crisis A van carrying volunteers joining Iraqi security forces against Jihadist militants. Prime Minister Nuri al-Maliki announced the Iraqi government would arm and equip civilians who volunteered to fight AFP/Getty In pictures: The rise of Isis Iraq Fighters of the Isis group parade in a commandeered Iraqi security forces armored vehicle down a main road at the northern city of Mosul In pictures: The rise of Isis Iraq An Islamist fighter, identified as Abu Muthanna al-Yemeni from Britain (R), speaks in this still image taken undated video shot at an unknown location and uploaded to a social media website. Five Islamist fighters identified as Australian and British nationals have called on Muslims to join the wars in Syria and Iraq, in the new video released by the Isis In pictures: The rise of Isis Iraq Al-Qa’ida inspired militants stand with captured Iraqi Army Humvee at a checkpoint belonging to Iraqi Army outside Beiji refinery some 250 kilometers (155 miles) north of Baghdad. The fighting at Beiji comes as Iraq has asked the U.S. for airstrikes targeting the militants from the Isis group. While U.S. President Barack Obama has not fully ruled out the possibility of launching airstrikes, such action is not imminent in part because intelligence agencies have been unable to identify clear targets on the ground, officials said In pictures: The rise of Isis Iraq Militants attacked Iraq's main oil refinein Baiji as they pressed an offensive that has seen them capture swathes of territory, a manager and a refinery employee said In pictures: The rise of Isis Iraq Militants from the Isis group parading with their weapons in the northern city of Baiji in the in Salaheddin province In pictures: The rise of Isis Iraq A smoke rises after an attack by Isis militants on the country's largest oil refinery in Beiji, some 250 kilometers (155 miles) north of the capital, Baghdad. Iraqi security forces battled insurgents targeting the country's main oil refinery and said they regained partial control of a city near the Syrian border, trying to blunt an offensive by Sunni militants who diplomats fear may have also seized some 100 foreign workers In pictures: The rise of Isis Iraq Militants of the Isis group stand next to captured vehicles left behind by Iraqi security forces at an unknown location in the Salaheddin province. For militant groups, the fight over public perception can be even more important than actual combat, turning military losses into propaganda victories and battlefield successes into powerful tools to build support for the cause In pictures: The rise of Isis Iraq An injured fighter (C) from the Isis group after a battle with Iraqi soldiers at an undisclosed location near the border between Syria and Iraq In pictures: The rise of Isis Iraq Fighters from the Isis aiming at advancing Iraqi troops at an undisclosed location near the border between Syria and Iraq In pictures: The rise of Isis Iraq Fighters from the Isis group taking position at an undisclosed location near the border between Syria and Iraq In pictures: The rise of Isis Iraq Fighters from the Isis group inspecting vehicles of the Iraqi army after they were seized at an undisclosed location near the border between Syria and Iraq In pictures: The rise of Isis Iraq One Iraqi captive, a corporal, is reluctant to say the slogan, and has to be shouted at repeatedly before he obeys Sky News In pictures: The rise of Isis Iraq Iraqi captives held by the extremists Sky News In pictures: The rise of Isis Iraq Iraqi captives held by the extremists Sky News In pictures: The rise of Isis Iraq Militants of the Isis group force captured Iraqi security forces members to the transport In pictures: The rise of Isis Iraq Militants of the Isis group transporting dozens of captured Iraqi security forces members to an unknown location in the Salaheddin province ahead of executing them In pictures: The rise of Isis Iraq A major offensive spearheaded by Isis but also involving supporters of executed dictator Saddam Hussein has overrun all of one province and chunks of three others In pictures: The rise of Isis Iraq Militants of the Isis group executing dozens of captured Iraqi security forces members at an unknown location in the Salaheddin province In pictures: The rise of Isis Iraq Isis militants taking position at a Iraqi border post on the Syrian-Iraqi border between the Iraqi Nineveh province and the Syrian town of Al-Hasakah In pictures: The rise of Isis Iraq Isis rebels show their flag after seizing an army post AFP/Getty Images In pictures: The rise of Isis Iraq Isis militants waving an Islamist flag after the seizure of an Iraqi army checkpoint in Salahuddin Getty Images In pictures: The rise of Isis Iraq Demonstrators chant slogans as they carry al-Qa’ida flags in front of the provincial government headquarters in Mosul, 225 miles (360 kilometers) northwest of Baghdad. In the week since it captured Iraq's second-largest city, Mosul, a Muslim extremist group has tried to win over residents and has stopped short of widely enforcing its strict brand of Islamic law, residents say. Churches remain unharmed and street cleaners are back at work

It is dangerous to describe any single phase of a long-running civil war as being decisive, but the coming months could be just that. The US and its allies in Syria, primarily the 25,000 fighters of the Kurdish People’s Protection Units (YPG) with some Sunni Arab allies, are eager to cut Isis off from its last link, through Turkey, to the outside world. They are not far from achieving this. Arab units of the Syrian Democratic Forces (SDF), an umbrella organisation dominated by the YPG, captured the Tishrin dam on the Euphrates, 55 miles east of Aleppo, on 23 December and are close to the Isis stronghold of Manbij.

Government forces recently seized Salma, pictured, from militants (AP)

The news that a movement few had heard of is threatening an obscure town in Syria was never going to set the world on fire. But it is important for three reasons: first, Isis is now almost sealed off within its self-declared caliphate; second, the Syrian Kurds, using their surrogate, the SDF, have crossed west of the Euphrates despite Turkey’s threats never to let this happen without a military response; third, and most important, the attack of the SDF was supported by both US and Russian air strikes, though not at the same time. “The Russians are now carrying out most of the air strikes there,” said a Syrian Kurdish representative. In other words, the US and Russia in this part of Syria are acting as if they had a de facto military alliance.

The big loser here could be Turkey, which seemed to be in such a strong position to extend its influence across the Middle East in 2011. Its image as an economically prospering, democratic yet Islamic, state was attractive to many Arab protesters looking to overthrow and replace dictatorial rule. But the Turkish President, Recep Tayyip Erdogan, soon made clear that he was supporting a Sunni Arab sectarian takeover that was anti-Shia, anti-Kurd and anti-secular and was bound to be resisted. Having first backed the Muslim Brotherhood, Turkey then tolerated or helped Isis, al-Nusra and extreme jihadi groups.

It was a calamitous miscalculation for Syria and for Turkey. For all President Erdogan’s neo-Ottoman dreams of making Turkey a great power in the Middle East again, he has achieved the opposite. How he responds to this failure should become clear in the coming months as the US and Russia try, in different ways, and in support of a rather different list of allies, to close the border between northern Syria and Turkey.

President Erdogan will either have to accept Turkey’s exclusion from northern Syria or increase Turkish military involvement, possibly including an invasion. Critical commentators in Turkey say he wanted to invade last year, but was restrained by senior Turkish army generals. Full-scale military engagement by Turkey would be more difficult today, since Russian military intervention and the shooting down of a Russian bomber by a Turkish F-16 on 24 November. A Turkish move into northern Syria now would face American disapproval and resistance by Russian aircraft and anti-aircraft missiles.