UN Secretary-General Ban Ki-moon has called for action to prevent a massacre of Palestinian refugees in Syria's Yarmouk camp, just after all Palestinian factions agreed with the Syrian government to use military force to expel Islamic State of Iraq and the Levant (ISIL) fighters from the embattled Palestinian refugee camp in Damascus.

"What is unfolding in Yarmouk is unacceptable," Ban told reporters at UN headquarters on Thursday. "We simply cannot stand by and watch a massacre unfold."

The UN chief's comments came after Ahmad Majdalani, the labour minister in the occupied West Bank-based Palestinian Authority, said that an agreement was reached between all Palestinian factions and Syrian leadership to continue consultations and to form a joint operations room with government forces.

ISIL fighters stormed the refugee camp and took over large parts of it just days ago, according to Palestinian and Syrian officials, creating what humanitarian groups have called a crisis in an already desperate situation for civilians living there.

It is unclear who exactly had signed onto the plan Majdalani told reporters about. Yarmouk is home to factions that support Syrian President Bashar al-Assad and groups that oppose him, and it was unclear whether Palestinians from both sides of the divide had indeed agreed to join forces.

There was no immediate word from the main Palestinian faction fighting ISIL in Yarmouk, known as Aknaf Beit al-Maqdis. The group is opposed to Assad and affiliated with Hamas.

Majdalani also said the Syrian government had agreed to ensure safe passage to refugees in Yarmouk and to provide them with shelter outside the camp.

'Deepest circle of hell'

Ban said that the Yarmouk camp is "the deepest circle of hell" in Syria's four-year civil war.

On Thursday, buildings at the northern entrance to Yarmouk were nothing but empty shells, their insides having been blown out by explosives and charred black by fire, according to an Associated Press reporter who visited the government-held segment of the camp. Walls were pockmarked by bullets.

Fighters had dragged battered water tanks into the streets to use them as barriers. Downed electricity cables and rubble covered the pavement. An aid distribution centre once run by the UN agency for Palestinian refugees, known as UNRWA, was totally destroyed by shelling.

The International Committee of the Red Cross (ICRC) has joined a growing chorus of aid groups calling for immediate access to the camp.

The ICRC said emergency medical care is "urgently needed" for the estimated 18,000 people still inside the camp, and warned that humanitarian needs "are growing by the day". It called on the armed factions to allow the "immediate and unimpeded passage" of humanitarian aid and to permit civilians who wish to flee to be able to do so.