In the midst of a winter storm last month, Mahdi al-Beij pitched his tent on the edge of a graveyard, hoping to have finally outrun a war that had hounded him and his clan throughout the province of Idlib for six insufferable years.

Floodwaters pooled nearby and a biting cold swept across the plains as the family settled in; accustomed to being exiles in their own land, but exhausted by their fifth move under fire and resigned to the next cruel twist fate may deliver them. Even if that meant being buried where they sheltered.

Facebook Twitter Pinterest Mahdi al-Beij, who fled Aleppo with his family, in a makeshift camp near the Syrian Turkish border. Photograph: Achilleas Zavallis/The Guardian

“Should the fighting reach us here, we won’t have to go too far,” said Al-Beij, 47, a shopkeeper from the Aleppo countryside. “And while we wait, at least we don’t have any problems with our neighbours. There is no better place to be.”

When they and other members of the cemetery’s living dead woke last Friday, the toll of the war had moved closer – four new graves, dug from the red earth only metres from their tent flaps, had been prepared for newcomers.

The bodies of the war’s latest dead were supposed to arrive at the cemetery overnight, but had instead been buried where they fell during an airstrike on another new camp nearby. The new graves would remain open for now, but even as a ceasefire took hold across Idlib – the latest attempt to broker an end to a mass suffering that has known no modern parallel – they would inevitably be put to use, in the coming days or hours.

Facebook Twitter Pinterest A freshly dug grave and nearby, tents set up by people fleeing a pro-government forces offensive, in a cemetery near the Syria-Turkey border. Photograph: Achilleas Zavallis/The Guardian

Nearby, two dogs slept on the tomb of a man who had died long ago, their emaciated frames slipping easily through the rusty fence that surrounded it. Children stared vacantly from behind tombstones. Their elders beckoned to them to join them in their mud-covered tents.

There were no planes in the skies for the first time in weeks, and the road in front that stretched from Idlib’s merciless battlefields to the right, and the safety of Turkey six miles to the left, was no longer cluttered with desperate, fleeing families.

Facebook Twitter Pinterest A young boy and his brother stand next to a truck at a makeshift reservation near the Syria-Turkey border. Photograph: Achilleas Zavallis/The Guardian

They had pulled off the road and had settled among olive groves and almond trees that lined routes connecting the province. Those lucky enough to find unused ruins had taken refuge among them. Formal camps, with healthcare and blankets, were the holy grail for Idlib’s newest exiles, but most had reached their capacity when towns and cities were overrun by the war and emptied out in late February, as Russian warplanes pulverised all beneath them and allowed forces fighting for the Syrian president to advance northwards.

“We’ll make do with what we have in this place,” said another cemetery resident, Ahmad Huesh, 54. “We’re all going to end up here anyway.” Another man, Mueid Hneish, had just arrived from the town of Ariha, which had been evacuated as regime forces and Shia militias had stormed towards it. That momentum had slowed after an airstrike killed at least 34 Turkish troops on 27 February, and which prompted a withering counter-attack by Ankara – not on Russian forces who had carried it out, but on Syrian troops and their allies on the ground.

In the village of Fuar, 10 miles further into Idlib, a member of the armed opposition against the Syrian leader, Lieutenant Naji Mustafa, said the Turkish offensive had rallied morale among the anti-Assad alliance. “Bashar al-Assad was not expecting to face what we had faced for so long,” he said of a three-day Turkish blitz that had killed hundreds of fighters and wiped out much of the Syrian army’s military hardware. “When you really look at the Syrian army, they are not on the same level as the Turks, or anyone else. When you really look at the Syrian state, you see with certainty that it has been run as a farm for the Assad family. It’s not a real country.”

Facebook Twitter Pinterest Naji Mustafa, a commander with the Northern Front, sits in a temporary HQ in Fuar. Photograph: Achilleas Zavallis/The Guardian

Fuar had long been a Shia town, one of two such areas in northwestern Syria that had been a focal point of Iranian efforts to defend the regime. The slain Iranian general Qassem Suleimani, who was killed by a US drone in Baghdad in January, had spent time in the town organising the recapture of Aleppo in late 2016 and had also overseen its evacuation shortly afterwards. That move had been sabotaged by a suicide bomber who killed close to 160 civilians in April 2017 as they waited to be evacuated. The headquarters of the group blamed for the attack, Jund al-Aqsa, now stands abandoned on a road leading towards Idlib city.

“It was an immoral thing to do, and it was not defensible,” said an opposition member. “They haven’t been forgiven.”

Since then the jihadists, who had established strongholds across Idlib throughout the Syrian war, have been less visible although still a presence.

As war rumbled on, the most dominant group – now known as Hayat Tahrir al-Sham (HTS) but once wedded to al-Qaida – had begun to cast itself as protectors of the civilian uprising against Assad, rather than proponents of a global jihad.

“It’s complicated,” said Lieutenant Naji, when asked about HTS. “For now we’re getting along with them and things are acceptable.”

Facebook Twitter Pinterest Ibrahim Mezin, a resident of Ariha who came back to the deserted town to check on his house. Photograph: Achilleas Zavallis/The Guardian

Elizabeth Tsurkov, a fellow at the Foreign Policy Research Institute who has studied HTS extensively, said the group appeared to have transformed – long a demand of governments who endorsed the humanitarian demands of the millions trapped in Idlib, but were determined not to deal with jihadists. “They truly severed ties with al-Qaida,” said Tsurkov. “The shift is strategic and stems from a realisation that they cannot survive as rulers of Idlib against the regime without foreign protection and backing, in this case, from Turkey.”

Facebook Twitter Pinterest People walking in a market in the centre of Idlib. Photograph: Achilleas Zavallis/The Guardian

Who fights the war and whatever might emerge from the ruins long ago ceased to be a concern for Idlib’s desperate residents, many of whom fled from elsewhere in Syria before ending up crammed into its last opposition-held corner. “Anyone who wants to stop Assad and his Shia mercenaries is welcome to,” said İbrahim Muezzin, on the outskirts of Ariha, a hillside town that was abandoned last month as regime ground forces approached. “I came back only to see my house,” he said. “It’s gone. Everything’s gone.”

Inside Ariha, the town’s main hospital lay in ruins, bombed two weeks earlier by a warplane. Congealed blood littered the floor of a corridor, and x-rays were scattered like confetti amid the rubble of a destroyed operating theatre.

Outside, an ambulance, crumpled by an explosion, stood covered by a tarpaulin. Another was on its side, obliterated by a warplane. The war on hospitals and all the other things needed to sustain civilian life was on brutal display: a market place, bread ovens, a school and even a mosque lay in ruins.

Facebook Twitter Pinterest Zaqwa al-Tamer walks past a row of bombed buildings in the town of Ariha, holding pieces of a Quran he salvaged from his destroyed house. Photograph: Achilleas Zavallis/The Guardian

Nearby, two men were looking through what remained of their homes. Zaqwa al-Tamer, his cheeks gaunt and eyes vacant, was cradling four pages of a Quran he had salvaged from his bedroom. “If I have this, nothing else matters,” he said.

Mohammed Isahib, another returnee, was a little luckier. Pointing to his flat in a damaged apartment building, he said: “Let’s stop talking about no-fly zones, the reality is we are dealing with no-life zones. Our choices are death or displacement. The agreement with the Turks and Russians [signed in Moscow the day before] means nothing. The real agreement is they will not leave anyone alone, especially on the M4 highway.”

Facebook Twitter Pinterest An abandoned ferris wheel and bombed buildings in the town of Ariha. Photograph: Achilleas Zavallis/The Guardian

A rusting, dilapidated ferris wheel stood between a gap in two buildings; fun died in Ariha long ago.

Down the nearby arterial route coveted by both sides, a lone armoured troop carrier, commandeered by an opposition group, belched its way towards a frontline near the town of Saraqeb. “We’re taking the war to them, these days,” said Lieutenant Naji. “Maybe the tables are turning.”

In Idlib, a revolutionary rally had gathered a large crowd in a central square. Men and a small number of women waved opposition flags and chanted taunts towards both the Syrian regime and opposition groups, including HTS. “We can do what we want now,” said Mahoud Ali Ismael, a trader from Hama, who had sought refuge in Idlib three years ago. “Six months ago, there would have been problems for all of us if we held a rally. They would have shot in the air and shut us down. But this is new and real. If only the world could see.”

Facebook Twitter Pinterest Men take part in a demonstration against the Syrian president Bashar al-Assad and his government in the city of Idlib. Photograph: Achilleas Zavallis/The Guardian

In the muddy fields near the Turkish border though, talk of uprising was long ago replaced by the reality of survival. “We lived that false hope for a while,” said Saleh Bneishi. “Those are their dreams, not ours anymore. Is it too much to hope for the world to tell Assad and the Russians to stop? I hope this last week has been a lesson for them.”

On the road back past the abandoned jihadist base, and as a short cruel winter drew to a close, a lone almond tree was covered in a white blossom. “Maybe that’s a sign of a good year ahead,” said Ahmad. “Our grandparents used to see it as an omen.”

Further north, in the graveyard, Abdur Rahman Helam, 19, said: “I don’t believe in anything anymore. Pointing to the tombstones, he said: “These are the best people I know. None of them bother us.”