Rebels in Homs are to abandon their stronghold in the Old City area in a deal that means the Syrian military will control of all but one neighbourhood of the country's third city.

The agreement, brokered after months of brutal fighting, calls for opposition forces to withdraw from their bastions during a ceasefire due to take effect at the weekend. About 1,000 fighters and their families are thought to remain in Homs.

If the deal is honoured, it will place Syria's resurgent military in firm control of a strategically important strip from Latakia in the north-west to Damascus – a significant blow to the opposition's three-year campaign to oust Bashar al-Assad.

Rebel leaders speaking from Homs said they had little choice but to yield after at least six relentless months of shelling that has taken them and the small number of families who remain in the Old City to the point of starvation.

Homs had become a heartland of Syria's civil war and the scene of some of the fiercest fighting in the past three years. Its proximity to the Lebanese border drew fighters from both sides; Sunni militants travelled to the city, determined to keep it from falling, while Hezbollah played an increasingly prominent role in ensuring it did just that.

Western officials in Beirut confirmed that the deal was due to take effect but warned that the Syrian military had not honoured an earlier ceasefire which offered safe passage to opposition fighters who wanted to quit the battle.

"Let's not forget that there was a UN-sponsored truce earlier in the year also, in the Old City, that will long live in infamy because all men of fighting age who surrendered were then arrested," one official said. "They have never been heard from again, and the UN did nothing about it."

Locally brokered ceasefires have taken effect elsewhere in Syria in recent months, notably in the Moadimeyah district of Damascus, which was also once a hub of opposition control.

The ceasefires are framed as a part of a national reconciliation but, in effect, amount to surrenders. They compel rebel groups to first raise the Syrian flag over a civic centre, then hand over heavy weapons in return for food. Some fighters who have complied have then been allowed to pass regime checkpoints. Others have been immediately detained.

While increasingly implemented at a micro-level, the deals have not before taken on the significance of the Homs arrangement.

The supremacy of Syria's air force in the skies over opposition-held towns and cities has been used with withering effect, particularly in Aleppo and the Idlib countryside, where rebel forces are regrouping after ousting the jihadist group Isis.

At the same time, the regime has employed "starve or submit" tactics which have weakened resolve in opposition areas. The denial of humanitarian aid has been in stark contravention of a UN security council resolution demanding that food and other essential supplies be allowed into all areas of the country.

With what appears to be the imminent fall of Homs, opposition leaders and senior regional diplomats are now openly questioning whether the opposition can hold on to other key areas it controls.

"There are two options," the western official said. "A stalemate slanting towards the regime, or a situation that really resembles a rebel implosion. Neither are good for the rebel side. They are clinging on to the hope that everything is being put on hold for the summer, when a push will come."

A second official with links to the Obama administration said the status quo appeared to be the best result opposition groups could hope for in the short term. "I can't see anything like the western-backed push that they need to get this rolling coming anytime soon," the official said. "The administration does not wnat to own the outcome."

Opposition leaders in northern Syria say they have been assured of increased support after forcing ISIS to flee from Idlib and Aleppo during three months of fighting from January that cost the lives of at least 2,500 rebels. The internecine warfare has continued in eastern Syria, with the al-Qa'ida-backed Jabhat al-Nusra battling ISIS for control of oil fields near the Iraqi border.

ISIS has regularly disavowed links to al-Qa'ida and defied the organisation's leader, Ayman al-Zawahiri, who took control after the death of Osama bin Laden three years ago.

Zawahiri released an audio tape on Friday that called for an end to fighting between the group. However earlier pleas have had little effect.