On Dec. 15, a major evacuation effort began in Aleppo, Syria after earlier failures to ferry out frightened residents and defeated fighters. (Louisa Loveluck, Jason Aldag/The Washington Post)

Buses and ambulances rolled out of the last rebel districts in the Syrian city of Aleppo on Thursday as part of a major evacuation that ended the opposition’s battle for its greatest stronghold.

They left behind one of the world’s great ancient cities, now shattered by brutal airstrikes from government-allied planes that have killed thousands of people and reduced infrastructure to rubble.

Reports from aid groups and the Turkish government suggested that more than 3,000 people — including hundreds of rebel fighters — had left in the early waves, monitored by the army of Syrian President Bashar al-Assad and his Russian allies.

Aerial video from eastern Aleppo, a part of the northern metropolis captured by the rebels in 2012, showed lines of green school buses stretching through the remains of once-crowded streets. In images posted to social media, families gathered at pickup points, huddling in near-freezing cold as they waited for rescue.

Some families burned heirlooms rather than leave them for pro-government forces. Others left graffiti messages of anger, sorrow and even hope of returning.

If all goes according to plan — never a certainty in Syria’s multilayered conflict — around 50,000 people are expected to leave before the end of the week, a senior Turkish official told the Reuters news agency.

Many aspects of the deal remain unclear, however, including what will happen to antigovernment fighters who choose to leave.

Their destination is the northwestern province of Idlib, which is dominated by hard-line Islamists and likely to soon become a new focus of the government’s military campaign.

The United Nations’ Syria envoy, Staffan de Mistura, warned Thursday that without a return to political negotiations, the area risks a grim fate.

“Without a political agreement or cease-fire, Idlib will be the next Aleppo,” he told reporters in Geneva.

In Washington, Secretary of State John F. Kerry said he had received word that, despite what appeared to be at least a temporary cease-fire and evacuation, “a convoy of injured people was fired on by either the regime or its allies” and that men between 18 and 40 were being detained at government checkpoints.

“Obviously, these actions are despicable. . . . The last thing anybody wants to see, and the world will be watching, is that that small area turns into another Srebrenica,” Kerry said, referring to the 1995 ethnic slaughter of Bosnian Muslims by Bosnian Serbs in the former Yugoslavia.

“We are seeing the unleashing of a sectarian passion. The Assad regime is . . . carrying out nothing short of a massacre,” he said in a State Department news briefing.

Pro-Assad forces pushed rebel fighters into a sliver of territory during a relentless month-long offensive. Although Aleppo’s evacuation will not halt the fighting in Syria, it marks a huge blow — tactically and symbolically — to rebel groups staring down the barrel of defeat.

The city now falls to the control of Syrian government forces — aided by Russia and Shiite militias backed by Iran — handing the biggest prize of the conflict to Assad. 

On Thursday, Assad hailed their victory as “the writing of history.” But those leaving Aleppo saw only misery and disappointment, as the West and its allies, including Persian Gulf Arab states and Turkey, struggled to find ways to aid rebels or deter Syrian forces.

“You don’t understand what we have lived through here. Death hung above us. The world turned their backs,” said Mohamed al-Halabi, an electrician whose entire family was killed when an airstrike destroyed his workshop. 

“Maybe today, finally, they will help us,” he added.

Hopes, however, have been dashed before. The evacuation effort had been called off twice in just 24 hours, underscoring the complex politics dominating Syria’s war and the high stakes over Aleppo.

Robert Mardini, the International Committee of the Red Cross director for the Middle East, said colleagues in Aleppo reported levels of suffering that few aid workers had seen before. 

“It’s hard to believe how they survived,” he wrote in a message on Twitter.

As the day wore on, smoke hung above Aleppo’s eastern districts. The Britain-based Syrian Observatory for Human Rights said some rebel groups had burned their headquarters. Some families also said they had burned treasured belongings.

Pro-government militiamen regularly loot the homes they retake.

Ahmed al-Mashadi, an engineer, said his wife had cried as she watched the flames creep through her wedding dress. “She couldn’t carry it, but she couldn’t leave it behind,” he said. 

Heba Habib in Cairo and Karen DeYoung, Brian Murphy and William Branigin in Washington contributed to this report.