As Aleppo entered the final hours of battle and rebels cling on to tiny pockets of the city, rebel officials have said a ceasefire agreement with the government has been reached.

Osama Abu Zayd, a legal adviser for umbrella group the Free Syrian Army, said a ceasefire was due to go into effect on Tuesday evening, and five buses of both rebels and civilians are supposed to leave the city Tuesday night or early Wednesday morning.

Details on the Turkish-Russian-brokered deal are thin on the ground. Diplomatic and humanitarian sources told The Independent it was unclear how long the truce would be in place, or how many people would be allowed to leave the rebel enclave.

There had been worries ahead of the deal that the Syrian government, so close to victory, would not heed the international community's call for a truce. The army will declare control of the whole of Aleppo “at any moment”, Syrian state television said on Tuesday afternoon, before the ceasefire was announced.

“We warily welcome [the ceasefire],” one Western diplomat said. “We'll believe it when we see it.”

“Nobody is going to harm the civilians,” Vitaly Churkin, Russia's envoy to the UN, stressed during an emergency meeting of the UN Security Council in New York to address the crisis.

Concerns for civilians' safety are more pressing than ever as militia forces loyal to Syrian President Bashar al-Assad were reported to have entered homes and killed at least 82 civilians during their advance on rebel-held territory.

Head of the UN's human rights office Rupert Colville said that six different sources had confirmed 82 non-combatants were shot in four different neighbourhoods overnight on Monday. The reports included 11 women and 13 children killed.

Syrian civilians flee the Sukkari neighbourhood towards safer rebel-held areas in southeastern Aleppo (Getty)

In Pictures: The crisis unfolding in Syria Show all 30 1 /30 In Pictures: The crisis unfolding in Syria In Pictures: The crisis unfolding in Syria A Syrian family arrives at a checkpoint, manned by pro-government forces, at the al-Hawoz street roundabout, after leaving Aleppo's eastern neighbourhoods Getty In Pictures: The crisis unfolding in Syria A Syrian woman, fleeing violence in the restive Bustan al-Qasr neighbourhood, reacts as she stands with her children in Aleppo's Fardos neighbourhood, after regime troops retook the area from rebel fighters Getty In Pictures: The crisis unfolding in Syria Syrian pro-regime fighters, gesture as they drive past resident fleeing violence in the restive Bustan al-Qasr neighbourhood, in Aleppo's Fardos neighbourhood Getty In Pictures: The crisis unfolding in Syria Syrian rebels withdrew from six more neighbourhoods in their one-time bastion of east Aleppo in the face of advancing government troops, the Syrian Observatory for Human Rights said Getty In Pictures: The crisis unfolding in Syria Syrian rebels withdrew from six more neighbourhoods in their one-time bastion of east Aleppo in the face of advancing government troops, the Syrian Observatory for Human Rights said Getty In Pictures: The crisis unfolding in Syria Syrian residents, fleeing violence in the restive Bustan al-Qasr neighbourhood, arrive in Aleppo's Fardos neighbourhood , after regime troops retook the area from rebel fighters Getty In Pictures: The crisis unfolding in Syria Syrian pro-regime fighters, gesture as they drive past residents fleeing violence in the restive Bustan al-Qasr neighbourhood, in Aleppo's Fardos neighbourhood Getty In Pictures: The crisis unfolding in Syria Syrian residents, fleeing violence in the restive Bustan al-Qasr neighbourhood, arrive in Aleppo's Fardos neighbourhood, after regime troops retook the area from rebel fighters Getty In Pictures: The crisis unfolding in Syria Syrian residents, fleeing violence in the restive Bustan al-Qasr neighbourhood, arrive in Aleppo's Fardos neighbourhood Getty In Pictures: The crisis unfolding in Syria A Syrian pro-regime fighter speaks with a child, as residents flee violence in the restive Bustan al-Qasr neighbourhood. Syrian rebels withdrew from six more neighbourhoods in their one-time bastion of east Aleppo in the face of advancing government troops AFP/Getty Images In Pictures: The crisis unfolding in Syria Smoke rises as seen from a governement-held area of Aleppo, Syria Reuters In Pictures: The crisis unfolding in Syria Syrian soldiers targeting rebels-held areas in the eastern neighborhoods in Aleppo, Syria. According to media reports, the army is now holding on 99 percent of Aleppoís eastern neighborhoods EPA In Pictures: The crisis unfolding in Syria Syrian pro-government forces patrol Aleppo's eastern al-Salihin neighbourhood after troops retook the area from rebel fighters Getty In Pictures: The crisis unfolding in Syria Syrian soldiers rest following the battle at al-Sheik Saeed neighborhood in Aleppo, Syria EPA In Pictures: The crisis unfolding in Syria A Syrian pro-government fighter walking past closed shops in the Bab al-Nasr district of Aleppo's Old City. Once renowned for its bustling souks, grand citadel and historic gates, Aleppo's Old City has been rendered virtually unrecognisable by some of the worst violence of Syria's war Getty In Pictures: The crisis unfolding in Syria The crucial battle for Aleppo entered its 'final phase' after Syrian rebels retreated into a small pocket of their former bastion in the face of new army advances. The retreat leaves opposition fighters confined to just a handful of neighbourhoods in southeast Aleppo, the largest of them Sukkari and Mashhad Getty In Pictures: The crisis unfolding in Syria Syrian civilans arrive at a checkpoint, manned by pro-government forces, at the al-Hawoz street roundabout, after leaving Aleppo's eastern neighbourhoods. Syria's government has retaken at least 85 percent of east Aleppo, which fell to rebels in 2012, since beginning its operation Getty In Pictures: The crisis unfolding in Syria Syrian civilians flee the Sukkari neighbourhood towards safer rebel-held areas in southeastern Aleppo Getty In Pictures: The crisis unfolding in Syria Syrians celebrate in the government-held Mogambo neighbourhood of the northern Syrian city of Aleppo, after rebel fighters retreated into a small pocket of their former bastion in the face of new army advances Getty In Pictures: The crisis unfolding in Syria Syrians celebrate in the government-held Mogambo neighbourhood of the northern Syrian city of Aleppo, after rebel fighters retreated into a small pocket of their former bastion in the face of new army advances. The fall of Aleppo would be the worst rebel defeat since Syria's conflict began in 2011, and leave the government in control of the country's five major cities Getty In Pictures: The crisis unfolding in Syria A Syrian refugee camp in the Bekaa Valley, Lebanon, close to the Syrian border PA wire In Pictures: The crisis unfolding in Syria Syrian refugee Aliya inside the tent where she lives with her husband and ten children in a camp in the Bekaa Valley, Lebanon, close to the Syrian border PA wire In Pictures: The crisis unfolding in Syria Syrian refugee women and children outside the entrance to their tents in the refugee camp in the Bekaa Valley, Lebanon, close to the Syrian border PA Wire In Pictures: The crisis unfolding in Syria A Syrian refugee camp in the Bekaa Valley, Lebanon, close to the Syrian border PA wire In Pictures: The crisis unfolding in Syria A Syrian refugee camp in the Bekaa Valley, Lebanon, close to the Syrian border PA Wire In Pictures: The crisis unfolding in Syria A Syrian refugee woman outside the entrance to the tent where her family live, in the refugee camp in the Bekaa Valley, Lebanon, close to the Syrian border PA wire In Pictures: The crisis unfolding in Syria A vehicle drives past a mosque at night in Idlib, Syria. Picture taken with a long exposure Reuters In Pictures: The crisis unfolding in Syria Damaged buildings stand in the rebel-controlled town of Binnish in Idlib province, Syria Reuters In Pictures: The crisis unfolding in Syria The night sky is seen through damaged windows in the rebel-controlled town of Binnish in Idlib province, Syria Reuters In Pictures: The crisis unfolding in Syria Damaged buildings stand in the rebel-controlled area of Maaret al-Numan in Idlib province, Syria Reuters

“Yesterday evening, we received further deeply disturbing reports that numerous bodies were lying on the streets,” he told reporters in Geneva. “The residents were unable to retrieve them due to the intense bombardment and their fear of being shot on sight.”

There has been a “complete meltdown of humanity in Aleppo”, UN spokesperson Jens Laerke added. About 100 children were trapped in a building under fire and separated from remaining family members on Tuesday, a doctor told Unicef.

An activist still in the city also said that snipers had shot at people on the streets.

Lynn Maalouf, deputy director for research at Amnesty International's Beirut office, said the reports that civilians, including children, were being massacred in cold blood were “deeply shocking but not unexpected”, given other such incidents in the war. She went on to call the allegations “war crimes”.

The Syrian military has denied the claims, calling them a “desperate attempt” to garner international sympathy.

On the government controlled side of the city, residents have been celebrating the fall of the rebels – who have killed hundreds of civilians in west Aleppo in rocket attacks – with music, dancing and fireworks.

Exact figures are difficult to verify, but between 50,000 and 100,000 civilians are still thought to be trapped by fighting in the rebel enclave, which is now as small as 2.5 square miles.

Videos reportedly taken inside the city show scenes of horrific destruction and human misery caused by intense bombing, as almost all medical and aid services have broken down. Scores of bodies remained trapped under rubble which are unreachable, the local White Helmets civil defence service said, and the UK-based Syrian Observatory for Human Rights confirmed.

For those left alive, what comes after the city falls may be even worse. Civilians and activists are afraid of detention or more executions by Shia militias allied to the Syrian government and army troops if they are suspected of being members of the opposition.

Several activists posted goodbye messages on Monday before going silent. “Anyone who knows anything about the Assad regime should know what to expect. Death will be a wish for those captured and deemed [to be] opposition, weather [sic] military or civil,” one wrote in a Whatsapp message to journalists.

Video shows Syrian Army taking Aleppo

Jan Egeland, the UN’s humanitarian adviser on Syria, tweeted that the Russian and Syrian governments would be responsible for any such abuses.

“The Gov'ts of Syria & Russia are accountable for any and all atrocities that the victorious militias in Aleppo are now committing!,” he wrote.

Reports have already emerged of up to 6,000 men in territory recaptured by the government being detained in the last month. There wherabouts are still unknown, the UN says.

Aleppo has been divided into a government-controlled west and rebel-controlled east more than four years.

East Aleppo’s supply chains were cut off in August, leaving its 250,000 residents and around 8,000 fighters – among them al-Qaeda affiliated forces – under siege conditions.