BEIRUT, Lebanon — Families, medical workers, insurgent fighters and wounded people were packed and ready Wednesday morning to vacate the ravaged rebel-held neighborhoods of the Syrian city of Aleppo under a deal between Russia and Turkey. Then the resumed booms of incoming artillery shells from pro-government forces sent them into hiding or running for their lives.

It was the latest life-or-death whiplash for the thousands trapped in the ruins of a once-vibrant northern metropolis, which has come to symbolize the atrocities unfolding in the nearly six-year-old war.

Under the supposed deal for a cease-fire and evacuation — announced on Tuesday by Turkey, Russia and Syrian rebels — the remaining fighters were to leave Aleppo for rebel-held territory farther north and civilians were free to join them or move to government-held areas.