Syrian opposition forces in eastern Aleppo on Tuesday agreed to a ceasefire with Bashar al Assad's forces to evacuate the besieged city, according to Turkish, Russian, Syrian and opposition sources.
Under the Turkey-brokered deal, evacuations will begin at 5am (0300 GMT) on Wednesday.
The deal will allow civilians trapped in the conflict zone to be bused to the western part of the city. Opposition fighters will then be evacuated.
Turkey brokered the ceasefire with Russia, despite Iranian and Hezbollah opposition, a Turkish official said.
Ankara sent buses to eastern Aleppo to begin the evacuation of civilians. But Hezbollah and other Shia militias in the area prevented them from boarding the buses. According to Turkish authorities, some civilians were detained by the militias.
Turkish Deputy Prime Minister Mehmet Simsek said Turkey was preparing to host 80,000 refugees from Aleppo.
The deal comes as the suffering in Aleppo deepens. Thousands of people fled the front lines on Tuesday as the Syrian regime and its allies advanced on the final pocket of opposition resistance.
The UN called the crisis in the city a "complete meltdown of humanity." The UN said there were reports of abuses, including the execution of 82 civilians, including 11 women and 13 children by the regime and alllied militia, in captured districts.
Turkey said it was "horrified and outraged" by reports of the massacre.
Since mid-November, more than 1,070 civilians have been killed in eastern Aleppo in attacks by the Syrian regime, its allies, and Russian warplanes, according to local sources.
In recent days, the Russia-backed Assad regime has re-established control over most of the city, including areas captured four years ago by the opposition.
Syria has been locked in a devastating civil war since early 2011, when the Assad regime cracked down on pro-democracy protests, which began as part of the ''Arab Spring'' uprisings.
Since then, hundreds of thousands of people have died in the conflict and millions have been displaced.