Islamic State (IS) militants have reportedly agreed to give up their last pocket in Damascus, as the government seeks to retake the entire Syrian capital and its surrounding areas for the first time since 2011.

The capitulation followed a week of escalations by pro-government forces against the IS-held Hajar al-Aswad area and Yarmouk Palestinian camp in Damascus.

Pro-government forces bombed the two areas and blanketed them with artillery fire in a manoeuvre captured by the state-affiliated Central Military Media outlet.

The UN’s refugee agency warned that the spiralling violence was a threat to 12,000 Palestinian refugees still there – Palestinians who came to Syria since 1948, and their descendants.

Militants were given the option to stay and reconcile with the government or leave on buses to IS-held territory in the eastern Syrian desert, the SANA state news agency said. It did not say when the relocations would begin.

The Syrian Observatory for Human Rights monitoring group reported “relative calm” in the two neighbourhoods after the announcement of the agreement.

In 2012, Syrian rebels and army defectors pushed pro-government forces out of Yarmouk in response to a spiralling crackdown by state security services against anti-government protests.

Pro-government forces, including pro-government Palestinian factions, responded by putting the camp under siege, eventually cutting off food and water by 2014, and bombing and shelling it continuously.

Residents trickled out to neighbouring areas, and the camp’s population dwindled from an estimated 200,000 people to a few thousand today, not including the IS militants, who took over the camp following a battle with rebels in 2015.

On Thursday, the Damascus-based Palestinian official Khaled Abdelmajid said the government was giving hard-liners two days to leave Yarmouk and Hajar al-Aswad, leaving the government with control of the two neighbourhoods.

That initial deal appears to have collapsed.