BEIRUT -- A ceasefire to evacuate rebel fighters and civilians from the remaining opposition-held neighbourhoods of Aleppo unraveled on Wednesday, once again raising the spectre of a bloody end to the battle for Syria's largest city as residents reported the resumption of shelling and brutal bombing runs.

Opponents of President Bashar Assad accused the government and its allies of scuttling the deal by adding new conditions, including the lifting of a rebel siege on two pro-government Shiite villages in nearby Idlib province.

However, hours after it crumbled, the rebels said the deal was back on. There was no comment from the government or its allies, and minutes after the new cease-fire was to take effect at 11:30 p.m. local time, there were still reports of shelling in the few blocks of the city under rebel control.

Three rebel spokesmen said the first group of wounded people and civilians were to be escorted out of the city early Thursday morning. They said the conditions had not changed, and that they had even agreed with the Russians on the exact number of buses and convoys to be deployed in the rescue.

The Syrian military media denied an agreement had been reached and said in a statement that the negotiations were "complicated."

The evacuation was to have begun at dawn Wednesday, but quickly derailed, descending into terrifying violence. Residents said government buses arrived in the pre-dawn hours at agreed upon meeting points, where the wounded were first in line to be evacuated after surviving weeks of intense fighting amid destroyed medical facilities and depleted supplies.

But they were turned away by pro-government militias manning the checkpoints. Then violence erupted: shelling and then airstrikes. The rebels retaliated, at one point shelling the pro-government villages of Foua and Kfraya in Idlib and detonating a car bomb in a frontline area.

Residents, activists and medical staff described mayhem in the tiny sliver of Aleppo still under opposition control as volleys of shells rained down on the area where tens of thousands of civilians were trapped alongside rebels in gutted apartment buildings and other shelters.

Videos shared online by residents huddling indoors recorded the sounds of war -- deafening explosions that highlighted fears of a bloodbath. Rescuers were overwhelmed and a comprehensive casualty toll was impossible.

"They began to strike as if there's no such thing as a cease-fire or civilian evacuation," said Mahmoud Raslan, a local media activist.

Mohammed Abu Jaafar, head of forensics in eastern Aleppo, said residents felt "duped."

"People have left their shelters .... to be ready for the evacuation. I can't describe it," Abu Jaafar said. "Since the morning, they started to target the areas where people have gathered ... These people were walking to the crossings designated for exit."

The initial evacuation deal was mediated late Tuesday by Turkey and Russia as the rebel enclave rapidly dissolved, ceding more and more territory in the face of the brutal advance by Syrian forces, backed by Russia and Shiite militias from Lebanon, Iraq and Afghanistan. Along with Russia, Iran backs Assad's government and has committed advisers and elite Revolutionary Guard forces to the government side. Turkey backs some of the rebel groups fighting to topple Assad.

It was an effective surrender of the rebel fighters who had held onto nearly half of Aleppo for more than four years.

Rebel Spokesman Bassam Haj Mustafa accused the Syrian government and Iran of foiling the deal by imposing new conditions on the rebels, including lifting the opposition's monthslong siege of the Shiite villages of Foua and Kfraya in Idlib province. Calling that an "excuse," he added: "They want a massacre and not concessions."

Osama Abo Zayd, a legal adviser for the rebels, said that in talks to salvage the deal, the rebels offered to evacuate the wounded in the two towns, but said the matter was left to later negotiations that would also include the future of two Sunni towns besieged by government forces. He said Russian pressure rescued the deal.

Rami Abdurrahman, the head of the Britain-based Syrian Observatory for Human Rights, said the Syrian government and its allies also wanted the release of their fighters taken hostage by the rebels as well as the handover of over 250 wanted militant fighters.

"In exchange for this large numbers of evacuees, they want something in return," Abdurrahman said. He estimated there were 5,000 fighters still in the opposition enclave, as well more than 15,000 civilians. Tens of thousands have already fled to government areas.

Abo Zayd said Iran also demanded the return of the remains of Iranians killed in Aleppo.

Assad, speaking in a series of interviews with Russian media on Wednesday, said the cease-fire was designed to stop his government's advance in the city and "keep the terrorists and save them."

He said Western countries pressured Russia for the truce when rebels appeared to be on the verge of losing Aleppo. "Hostilities end only in the areas where terrorists say they are ready to surrender or leave," Assad said.

Asked if the Syrian army will move in on rebel-held territory in Idlib after taking Aleppo, he said Damascus would work out further military action with Moscow and Tehran after the government takes full control of Aleppo. "What city will be liberated next depends on where most terrorists receiving logistical assistance from abroad" are located, Assad said.

As the cease-fire collapsed early Wednesday, there was a flurry of diplomatic calls. Turkish Foreign Minister Mevlut Cavusoglu and his Russian counterpart, Sergey Lavrov, spoke by telephone. Cavusoglu later spoke with U.S. Secretary of State John Kerry. Meanwhile, Turkish President Recep Tayyip Erdogan and Russian President Vladimir Putin also spoke.

The surrender of Aleppo's remaining opposition-run neighbourhoods to government control would be a turning point in Syria's civil war, allowing Assad control of most of the country's urban centres.

Mahmoud Bitar, a Syrian human rights activist based in Turkey who is contact with those trapped, said some civilians burned their houses because they didn't want the militias to take over their belongings and houses.

"They thought they were going to get out but the militias stopped the ambulances at the checkpoints. Now they have nowhere to stay because the area is overwhelmed with people."

------

Soguel reported from Istanbul. Associated Press writers Philip Issa in Beirut, Vladimir Isachenkov in Moscow and Ayse Wieting in Istanbul contributed to this report.