Sheikh Habib sits with the smartly dressed mayor of Talkalakh and other officials of this small Syrian city, drinking coffee and eating chocolates beneath a portrait of President Bashar al-Assad.

Five minutes later, we have climbed into the sheikh's white 4x4, crossed a railway line, been waved past an army checkpoint, driven 300 yards up a street of badly ruined shops and houses, and are shaking hands with a swarthy, bearded figure in a woolly hat and black leather jacket who emerges from behind a wall. Our new host is Abu Oday, the commander of the armed opposition in this town in the western corner of Syria, and what we are witnessing is one of the most extraordinary facets of the country's catastrophic civil war: the birth pangs of a truce that has restored calm to one small area after almost two years of violence.

Abu Oday carries no gun, nor do any of the dozen men who stand around us curiously as plastic chairs are drawn up. By agreement they no longer show their weapons while, for its part, the Syrian army has ended the regular hail of mortar fire that terrorised this side of Talkalakh.

The architect of the change is Sheikh Habib or, to give him his full name, Mohammed Habib Fendi. Barely mentioned in Syria's official media, he prefers to keep a low profile even though he seems a rare hero in the country's brutal conflict. He heads a Sunni tribe in al-Raqqa, a city on the Euphrates in north-eastern Syria, and is a regular preacher at Friday prayers. But his political work began after he took part in one of many delegations of local people whom Assad started inviting to Damascus soon after the uprising began in 2011.

The aim was to discuss their grievances and see whether "reconciliation" could be used by tribal and community leaders as a way to end the mounting street protests. The policy was an implicit admission that the ruling Ba'ath party had become an empty shell, more associated with corruption and security control than with providing services, let alone justice, fairly.

As protesters moved from peaceful demonstrations to armed resistance following the government's mass arrests in 2011 and the heavy use of force last year, reconciliation made little headway. The arrival of foreign jihadis, the Islamisation of large parts of the opposition, and the onset of sectarian clashes created new tensions and made compromise harder.

An alternative to permanent war

But now, as the war's death toll mounts with no prospect of an early end, reconciliation is making a hesitant comeback. The bleakness of the nation's outlook, indeed of the country's very survival, makes it seem a better alternative than permanent war.

"I am religious and I have an idea – perhaps it's crazy – of leadership via love", said Habib.

Talkalakh is the place where he has achieved his best results so far: close to the Lebanese border, most of the town's 30,000 people used to farm or make their living from smuggling. Made up of Sunnis and Alawites, the minority from whom the Assad family comes, the town and surrounding villages are a microcosm of the conflict ravaging the country.

The governor of Homs province strongly supports the sheikh's ceasefire efforts, but the army is leery. The local commanding officer (who declined to give his name) first claimed it was too dangerous for us to cross the frontline. When the sheikh insisted, the colonel urged him to tell us that the rebel leader did not want to be interviewed and so there was little point in our going. In between these falsehoods he declared 90% of the town's population supported President Assad and the British government was making a mistake by supporting jihadi fundamentalists in Syria because they would turn against Britain in the end.

Sheikh Habib had explained to us that Talkalakh's reconciliation agreement had several stages. First, there would be a ceasefire. Then the rebels, all of whom were Sunnis, would stop patrolling with their weapons while the pro-government militias – the Alawite shabiha – would stay away from Sunni villages. , Abu Oday, the rebel leader, would collect his men's weapons and secure them, in return for which the shabiha would be replaced by proper troops. Finally, the rebels would surrender their weapons and the army would withdraw from the area.

Abu Oday turned out to be eager to talk to me. "Ask anything you like", he said, as Sheikh Habib and I sat down with him in a half-finished building. The petrol station opposite had been destroyed and several houses across the square bore mortar scars, but there was no sign that the area was under siege. Shops were selling fruit and vegetables and women and children went in to buy them with no sign of the fear that must have reigned before the ceasefire.

No jihadis here

"I used to work in real estate in Saudi Arabia, but came back here when the revolution started," Abu Oday said. Anticipating my question, he went on: "I'm not religious. I only have a beard because we have no time to shave. There are no foreign fighters with us. We are all local, 100%. This is a Sunni part of town and we are all Sunnis.

"We started here with peaceful demonstrations for justice. It was only when the regime responded with force that we started to call for freedom and the end of the regime. That's what we still want. When they attacked us and made arrests we had to defend ourselves", he went on. The regime's claims that there were hardline Islamists in rebel ranks were only a ploy to blacken the rebels' image, he said.

In spite of the ceasefire the sheikh had organised, – here Abu Odeh nodded appreciatively at the sheikh who nodded back – people on this side of town were afraid to cross the railway line to the other side in case they were detained.

And the ceasefire was being violated, he said. "We only control about three streets. Up there" – he pointed over the ruined petrol pumps to the mouth of a side-street – "there are snipers. The day before yesterday, in broad daylight, a lawyer was up on his roof feeding his pigeons. He was shot in the neck. The sheikh helped to get him safe passage to hospital.

"We have agreed a ceasefire, but we're still not ready to trust the government," he said.

He could not say when they would move to the next stage of the agreement and was not yet convinced the government did not want to drive Sunnis out of the town. His views made it clear that confidence-building in Talkalakh still has a long way to go.