BEIRUT (Reuters) - The Syrian army said it had retaken complete control of Aleppo on Thursday after the last rebel fighters were evacuated from the battered city, handing President Bashar al-Assad his biggest victory of the nearly six-year-old war.

The military said it had brought “the return of safety and security to the city of Aleppo”, ending four years of rebel resistance in the northern Syrian city.

“This victory constitutes an important turning point,” an army statement said.

The recapture of Aleppo is Assad’s most important gain so far in a war that has claimed 300,000 lives. But the fighting is not over with large parts of the country still controlled by insurgent and Islamist groups.

Assad said retaking Aleppo was a victory shared with his Russian and Iranian allies. Russia’s air force conducted hundreds of raids that pulverized rebel-held parts of Aleppo. Iranian-backed militias, led by the Lebanese group Hezbollah, poured thousands of fighters into the city.

In the western part of the city, controlled by the government throughout the war, there was celebratory gunfire, fireworks and street parties on Thursday night, witnesses said. Crowds sang, danced and waved flags and pictures of Assad, chanting slogans praising the army and the president.

The last group of rebels and their families holed up in a small eastern enclave of Aleppo were evacuated under a deal that gave the army and its allies full control of the city, Syrian state television said.

At least 34,000 people, both civilians and fighters, have been evacuated from east Aleppo in a week-long operation hampered by severe winter weather, according to the United Nations, which estimates that thousands more remain behind.

“The process for evacuation was traumatic, with crowding, and vulnerable people waiting for hours and exposed to sub-zero temperatures,” U.N. spokesman Farhan Haq told reporters in New York.

Remaining civilians must be allowed to leave safely if they choose to do so, he said.

The last evacuees left a tiny pocket that was all that remained of a rebel sector that once covered nearly half the city before being besieged in the summer and hit by intense air strikes that reduced much of it to rubble. As the months of bombardment wore on, rescue and health services collapsed and casualties mounted.

FINAL PHASE

The final phase of the evacuation ended when a convoy carrying nearly 150 people, including fighters and members of their families, departed toward rebel-held areas outside the city, state television said.

Slideshow ( 12 images )

State media showed a convoy crossing from the Ramousah highway junction in south Aleppo to al-Rashideen in the countryside just southwest of the city.

“A short while ago, the last group from Aleppo arrived in the western countryside,” said a spokesman for the Ahrar al-Sham rebel group.

In parallel, two buses carrying people from the pro-government villages of al-Foua and Kefraya, besieged by rebels in Idlib province, arrived in government-held Aleppo.

Slideshow ( 12 images )

A total of 900 people were transferred from the villages to government-held parts of Aleppo during the week-long evacuation process, according to the Syrian Observatory for Human Rights, a group that monitors the war.

Government forces had insisted the two villages must be included in the deal to bring people out of Aleppo.

Under a deal brokered by Turkey and Russia, convoys of buses and cars have shuttled thousands of civilians and fighters out of Aleppo’s last rebel-held pocket toward opposition areas outside the city since late last week.

“It’s done. The evacuation process has ended and the last bus has come out,” said Ahmad al-Dbis, a medical aid worker heading a team evacuating patients from Aleppo.

The U.S. State Department said it did not dispute the Syrian army’s statement that it had taken control of all of Aleppo. But State Department spokesman John Kirby added, “They are also responsible for the devastation and the havoc, and the starvation and atrocities they caused in the taking of Aleppo.”

The United States has been absent from negotiations that culminated in a ceasefire deal in Aleppo and watched from the sidelines as Assad and his allies, including Russia, mounted an assault against the rebels in east Aleppo.

‘THE NEXT ALEPPO’

The arrival of thousands of refugees from Aleppo in Idlib aroused fears that the rebel-held city in northwestern Syria could be next. Assad has said the war is far from over and his armed forces would march on other rebel areas.

“Many of them have gone to Idlib, which could be in theory the next Aleppo,” U.N. Special Envoy Staffan de Mistura said in Geneva.

He said a cessation of hostilities across Syria was vital if another battle like the bloody struggle for Aleppo was to be avoided.

In comments after meeting a senior Iranian delegation, Assad said his battlefield successes were a “basic step on the road to ending terrorism in the whole of Syria and creating the right circumstances for a solution to end the war”.

Russian Defense Minister Sergei Shoigu said Russian air strikes in Syria had killed 35,000 rebel fighters and halted a chain of revolutions in the Middle East.