When Staffan de Mistura took up his post as the United Nations envoy for Syria four years ago, he would have encountered a very different country to the one he leaves behind.

Back then, fighting raged in almost every part of the country and a sizeable armed opposition, albeit divided, still threatened the rule of President Bashar al-Assad.

Today, following an announcement from de Mistura that he is to step down, the Syrian government is firmly back in control of most of the country and violence has subsided, but the UN has been sidelined to the point of irrelevance.

The Italian-Swedish diplomat brought with him a wealth of valuable experience and a reputation for dealing with intractable problems. He had previously served as a deputy foreign minister in the Italian government and as the head of the UN mission in Afghanistan. In the run-up to 2009 provincial elections in Iraq, he played a key role in diffusing tensions in the sectarian hotbed of Kirkuk.

But Syria was a task like no other. He was the third envoy to try to bring Syria’s warring sides together. Algerian diplomat Lakhdar Brahimi and Kofi Annan had made short-lived attempts before him. The former UN chief famously described the role as “mission impossible”, but de Mistura tested that theory to breaking point.

His defenders argue that he was dogged in pursuit of an impossible task, navigating the interests of not only the Syrian government and the opposition, but of Russia, the US, Iran and Turkey too. But whereas his predecessors stepped down quickly when it became clear that the Syrian government was focused on a military victory, critics say de Mistura hung on too long.

“I think a lot of people expected him to resign a lot sooner, when it became clear that the process was going nowhere,” said Nour Bakr, who works for Independent Diplomat, a non-profit diplomatic consultancy that advises the Syrian opposition and has been involved with every round of Geneva talks during de Mistura’s tenure.

Bakr, and a number of diplomats who have worked alongside or close to de Mistura, described to The Independent how the envoy remained committed to a peace process that was repeatedly undermined by actions on the ground, and how he underestimated the Syrian government and its allies.

“His difficulties started when the US became less involved," Bakr said. “He made a not unfair calculation to take the process where the leverage is, and that unfortunately meant going in the direction the Russians wanted. The Russians used de Mistura to an extent, and used the political process to give cover for their brutal military campaign on the ground.”

The Russians used de Mistura to an extent, and used the political process to give cover for their brutal military campaign on the ground Nour Bakr, advisor to Syrian opposition

Robert Ford, the US ambassador to Syria from 2011 - 2014, worked with de Mistura in Iraq before he took up his post in Damascus. He described him as a “skilful” diplomat with a difficult task, but that he had made mistakes.

“His drive over the past year to secure constitutional reform, while understandable in the context of a genuine human desire to help Syria, misunderstands the brutal nature of the Syrian security state and that state's complete disregard for the rule of law,” he said.

Ford, a fellow at the Middle East Institute and Kissinger Senior Fellow at the Jackson Institute for Global Affairs, said he also took issue with de Mistura’s position on accepting the Assad government's role in blocking aid to opposition-held communities while aid deliveries to government-held communities continued uninterrupted.

De Mistura might have been able to weather some of these challenges were it not for some early missteps.

Charles Lister, an analyst at the Middle East Institute who was involved in intensive backchannel talks with the Syrian opposition in 2016, said de Mistura “was clearly determined to make something work on the political track, and his grit and persistence can’t be denied”.

But he added that the envoy displayed “a remarkable lack of judgment” in his early days, which damaged his reputation with the opposition.

“He paid multiple visits to the regime and its partners before he took the time to reach out and meet with the Syrian opposition,” Lister said, by way of example.

The result, as far as the opposition saw it, was a skewed process in which the UN was ignored and the balance of power lay firmly with the Syrian government and its superpower backer. With Russia’s entry into the war, the Syrian government had little motivation to negotiate and the talks drifted into farce.

But de Mistura had his own frustrations with the opposition. After several rounds of failed talks last year, he bluntly told the opposition that it was not strong enough militarily to continue to demand concessions from the government. Speaking ahead of peace talks, he posed the question: “Will the opposition be able to be unified and realistic enough to realise they did not win the war?”

Fears for 3m people in rebel-held Idlib ahead of regime offensive Show all 13 1 /13 Fears for 3m people in rebel-held Idlib ahead of regime offensive Fears for 3m people in rebel-held Idlib ahead of regime offensive A Syrian protester waves a flag of the opposition as during a protest against the regime and its ally Russia, in the rebel-held town of Maaret al-Numan in the north of Idlib province AFP/Getty Fears for 3m people in rebel-held Idlib ahead of regime offensive Syrian rebel fighters from the recently-formed "National Liberation Front" stand guard over a trench as rebels prepare defensive positions in anticipation for an upcoming government forces offensive AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive Syrians chant slogans and wave flags of the opposition as they protest against the regime and its ally Russia, in the rebel-held town of Maarrat al-Numan in the north of Idlib province on August 31, 2018. - Its hospitals are battered, residents heavily dependent on aid and escape routes to neighbouring Turkey sealed. If attacked by government forces, Syria's rebel-held Idlib is poised for a humanitarian calamity. (Photo by Zein Al RIFAI / AFP)ZEIN AL RIFAI/AFP/Getty Images ZEIN AL RIFAI AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive Syrian rebel fighters pile-up sandbags AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive Syrians chant slogans and wave flags of the opposition as they protest against the regime and its ally Russia, in Binnish in Syria's rebel-held northern Idlib province on August 31, 2018. (Photo by Muhammad HAJ KADOUR / AFP)MUHAMMAD HAJ KADOUR/AFP/Getty Images MUHAMMAD HAJ KADOUR AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive A Syrian rebel fighter looks through an embrasure in a make-shift bunker AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive A Syrian protester chants slogans as he waves a flag of the opposition as he protest against the regime and its ally Russia, in the rebel-held town of Maaret al-Numan in the north of Idlib province on August 31, 2018. - Its hospitals are battered, residents heavily dependent on aid and escape routes to neighbouring Turkey sealed. If attacked by government forces, Syria's rebel-held Idlib is poised for a humanitarian calamity. (Photo by Zein Al RIFAI / AFP)ZEIN AL RIFAI/AFP/Getty Images ZEIN AL RIFAI AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive Syrian rebel fighters walk through a trench AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive A Syrian protester waves a flag of the opposition AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive A Syrian rebel fighter stands guard over a trench AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive A Syrian rebel fighter from the recently-formed "National Liberation Front" walks through a trench as rebels prepare defensive positions in anticipation for an upcoming government forces offensive, in the countryside of the rebel-held northern Idlib province on August 31, 2018. - In recent days, both the government and its ally Russia have stepped up their rhetoric against the rebel presence in Idlib as they gear up for an assault, which could be the last major battle of the civil war that has torn the country apart since 2011. (Photo by OMAR HAJ KADOUR / AFP)OMAR HAJ KADOUR/AFP/Getty Images OMAR HAJ KADOUR AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive Syrians chant slogans and wave flags of the opposition as they protest against the regime and its ally Russia, in Binnish in Syria's rebel-held northern Idlib province on August 31, 2018. (Photo by Muhammad HAJ KADOUR / AFP)MUHAMMAD HAJ KADOUR/AFP/Getty Images MUHAMMAD HAJ KADOUR AFP/Getty Images Fears for 3m people in rebel-held Idlib ahead of regime offensive Syrian rebel fighters from the recently-formed "National Liberation Front" walk through a a trench as they prepare defensive positions in anticipation for an upcoming government forces offensive, in the countryside of the rebel-held northern Idlib province on August 31, 2018. - In recent days, both the government and its ally Russia have stepped up their rhetoric against the rebel presence in Idlib as they gear up for an assault, which could be the last major battle of the civil war that has torn the country apart since 2011. (Photo by OMAR HAJ KADOUR / AFP)OMAR HAJ KADOUR/AFP/Getty Images OMAR HAJ KADOUR AFP/Getty Images

To many Syrians, de Mistura’s efforts to remain neutral in pursuit of a fruitless process often bordered on callousness.

“To close your eyes to injustice to show you are neutral, this is not fair, this is not the United Nations,” said Abdulkafi al-Hamdo, a teacher and anti-government activist who survived the siege of Aleppo before escaping to Idlib.

Hamdo, like many others who supported the uprising against Assad, saw a false equivalence in de Mistura’s words, between the crimes of the government and the rebels who opposed him.

“Even when we were in Aleppo and we were besieged, we were killed, suffering, he was speaking about Isis and al-Qaeda. What about these children who were dying?”

But if the sign of a good mediator is to leave both sides unhappy then de Mistura can claim some degree of success. It was not only the opposition that felt hard done by.

De Mistura was clearly determined to make something work on the political track, and his grit and persistence can’t be denied Charles Lister, analyst at the Middle East Institute

An article in the pro-Syrian government Al-Watan newspaper this week described the UN envoy as having been “transformed into a spokesperson for the opponents of the Syrian state”.

Elia Samman, an adviser to the Syrian Ministry of National Reconciliation, echoed that claim, telling The Independent De Mistura "was not able to achieve a lot on the political level because he and his team had fallen under the influence of foreign governments intervening in the Syrian crisis."

De Mistura continued to pursue peace talks aimed at a transition of power and a new constitution for Syria. From 2016, he led several rounds of talks in Geneva, which led nowhere. Eventually a parallel process set up by Russia, Iran and Turkey – known as the Astana talks – sidelined the UN process.

That process led eventually to a landmark agreement between Russia and Turkey that was widely credited with avoiding a devastating government offensive in Idlib. The leaders of Turkey, Russia, Germany and France will hold a summit next week to discuss long-term solutions for Idlib, and a wider political process for the resolution of the Syrian conflict.

Towards the end of his tenure, de Mistura’s focus turned from a political solution to reducing violence and de-escalation, but many agreements ended the same way, with the eventual use of force by Russia and the Syrian army to recapture rebel-held areas.

Nevertheless, de Mistura worked tirelessly to negotiate ceasefires wherever possible.

“We will continue asking until we are red in the face, blue in the face for both sides ... to stop shelling each other’s area,” de Mistura told reporters about one such ceasefire effort earlier this year.

Praising those efforts this week following the announcement of his departure, US State Department spokesperson Heather Nauert said de Mistura has “worked tirelessly to find a solution to the Syrian crisis”.

War Child: 17-year-old Syrian refugee Thaer showcases rapping skills following youth empowerment scheme

She added that he had “saved lives by working to deescalate the violence that has engulfed the country, and eased suffering by constantly pressing for unhindered delivery of vital medical and humanitarian aid to Syrians in need”.

In the last few months, de Mistura’s efforts have been focused on convening a committee to rewrite Syria’s constitution.

Announcing his departure on Wednesday for “purely personal reasons”, he said he would continue to push for that goal.

“A month can be a century in politics,” he said. “We will still have a very intense and, hopefully, fruitful month ahead. I am not laying down the charge until the last hour of the last day of my mandate.”