ALEPPO, Syria/BEIRUT/GENEVA (Reuters) - Rebel resistance in the Syrian city of Aleppo ended on Tuesday after years of fighting and months of bitter siege and bombardment that culminated in a bloody retreat, as insurgents agreed to withdraw in a ceasefire.

The battle of Aleppo, one of the worst of a civil war that has drawn in global and regional powers, has ended with victory for Syrian President Bashar al-Assad and his military coalition of Russia, Iran and regional Shi’ite militias.

For rebels, their expected departure with light weapons starting on Wednesday morning for opposition-held regions west of the city is a crushing blow to their hopes of ousting Assad after revolting against him during the 2011 Arab uprisings.

However, the war will still be far from over, with insurgents retaining major strongholds elsewhere in Syria, and the jihadist Islamic State group holding swathes of the east and recapturing the ancient city of Palmyra this week.

“Over the last hour we have received information that the military activities in east Aleppo have stopped, it has stopped,” Russian U.N. Ambassador Vitaly Churkin told a heated U.N. Security Council meeting. “The Syrian government has established control over east Aleppo.”

Rebel officials said fighting would end on Tuesday night and a source in the pro-Assad military alliance said the evacuation of fighters would begin at around dawn on Wednesday. A Reuters reporter in Aleppo said late on Tuesday that the booms of the bombardment could no longer be heard.

Fighters and their families, along with civilians who have thrown in their lot with the rebels, will have until Wednesday evening to quit the city, a Turkish government source said. The ceasefire was negotiated by Turkey and Russia, without U.S. involvement.

A commander with the Jabha Shamiya rebel group said that Aleppo was a moral victory for the insurgents. “We were steadfast ... but unfortunately nobody stood with us at all”, the commander, who declined to be identified, told Reuters.

“UNCOMPROMISING VICTORY”

The plight of civilians has caused global outrage in the wake of a sudden series of advances by the Syrian army and its allies across the rebel enclave over the past two weeks.

“We appear to be witnessing nothing less than ... a total uncompromising military victory,” U.N. Secretary-General Ban ki-Moon told the U.N. Security Council on Tuesday.

The rout of rebels from their ever-shrinking territory in Aleppo sparked a mass flight of terrified civilians and insurgents in bitter weather, a crisis the United Nations said was a “complete meltdown of humanity”. There were food and water shortages in rebel areas with all hospitals closed.

The United Nations earlier on Tuesday voiced deep concern about reports it had received of Syrian soldiers and allied Iraqi fighters summarily shooting dead 82 people in recaptured east Aleppo districts. It accused them of “slaughter”.

“The reports we had are of people being shot in the street trying to flee and shot in their homes,” said Rupert Colville, a U.N. spokesman. “There could be many more.”

“They have gone from siege to slaughter,” British U.N. ambassador Matthew Rycroft said. “Aleppo will join the ranks of those events in world history that define modern evil, that stain our conscience decades later - Halabja, Rwanda, Srebrenica and now Aleppo,” said U.S. ambassador Samantha Power.

The Syrian army has denied carrying out killings or torture among those captured, and its main ally Russia said on Tuesday rebels had “kept over 100,000 people in east Aleppo as human shields”.

An official with an Aleppo rebel group said the bulk of about 50,000 people was expected to be evacuated.

Fear stalked the city’s streets. Some survivors trudged in the rain past dead bodies to the government-held west or the few districts still in rebel hands. Others stayed in their homes and awaited the Syrian army’s arrival.

For all of them, fear of arrest, conscription or summary execution added to the daily terror of bombardment. “People are saying the troops have lists of families of fighters and are asking them if they had sons with the terrorists. (They are) then either left or shot and left to die,” said Abu Malek al-Shamali in Seif al-Dawla, one of the last rebel-held districts.

WASTELAND OF RUBBLE

A Syrian military source said the evacuation of fighters would start at 5 a.m. (0300 GMT) on Wednesday. The source said fighters’ families would also leave, but did not mention other civilian evacuations.

Slideshow ( 8 images )

“We’re going to watch this closely,” U.S. State Department spokesman John Kirby said. “Obviously if it is true and there has been a ceasefire arrangement reached that not only stops the bombing and the violence but allows people to safely leave Aleppo, we would welcome it.”

Behind those fleeing was a wasteland of flattened buildings, concrete rubble and bullet-pocked walls, where tens of thousands had lived until recent days under intense bombardment even after medical and rescue services had collapsed.

The once-flourishing economic center with its renowned ancient sites has been pulverized during the war which has killed hundreds of thousands of people, created the world’s worst refugee crisis and allowed for the rise of Islamic State.

The U.N.’s Colville said the rebel-held area had become “a hellish corner” of less than a square kilometer. Its capture was imminent, he added.

The Syrian army and its allies could declare victory at any moment, a Syrian military source had said earlier, predicting the final fall of the rebel enclave on Tuesday or Wednesday, after insurgent defenses collapsed on Monday.

Slideshow ( 8 images )

Terrible conditions were described by city residents.

Abu Malek al-Shamali, a resident in the rebel area, said dead bodies lay in the streets. “There are many corpses in Fardous and Bustan al-Qasr with no one to bury them,” he said.

“Last night people slept in the streets and in buildings where every flat has several families crowded in,” he added.

TIDE OF REFUGEES

State television broadcast footage of a tide of hundreds of refugees walking along a ravaged street, wearing thick clothes against the rain and cold, many with hoods or hats pulled tight around their faces, and hauling sacks or bags of belongings.

One man pushed a bicycle loaded with bags, another family pulled a cart on which sat an elderly woman. Another man carried on his back a small girl wearing a pink hat.

At the same time, a correspondent from a pro-Damascus television station spoke to camera from a part of Aleppo held by the government, standing in a tidy street with flowing traffic.

In some recaptured areas, people were returning to their shattered homes. A woman in her sixties, who identified herself as Umm Ali, or “Ali’s mother”, said that she, her husband and her disabled daughter had no water.

They were looking after the orphaned children of another daughter killed in the bombing, she said, and were reduced to putting pots and pans in the street to collect rainwater.

In another building near al-Shaar district, which was taken by the army last week, a man was fixing the balcony of his house with his children. “No matter the circumstances, our home is better than displacement,” he said.

“The crushing of Aleppo, the immeasurably terrifying toll on its people, the bloodshed, the wanton slaughter of men, women and children, the destruction – and we are nowhere near the end of this cruel conflict,” U.N. High Commissioner for Human Rights Zeid Ra’ad al-Hussein said in a statement.