BEIRUT — The Syrian city of Aleppo returned to government control Thursday after the last remaining opposition fighters and civilians evacuated, ending a four-year rebel hold over parts of the country.

The announcement was made through an army statement broadcast on Syrian state TV shortly after the last four buses carrying fighters left through the Ramousseh crossing. Western Aleppo erupted in celebratory gunfire seen on Syrian TV, which showed uniformed soldiers and civilians shouting slogans in support of President Bashar Assad.

The Syrian government's recapture of Aleppo is a major turning point in the Syrian civil war with potentially powerful political repercussions.

Syrians walks down a destroyed street in Aleppo's al-Akroub neighbourhood on Dec. 17. Youssef Karwashan / AFP - Getty Images

It represents a momentous victory for President Bashar Assad and a crushing defeat for Syria's opposition which will struggle to forge a way forward.

Related: Syrians Face an Uncertain Future After Being Evacuated From Aleppo

The ancient city has been divided into rebel and government parts since 2012.

"Thanks to the blood of our heroic martyrs, the heroic deeds and sacrifices of our armed forces and the allied forces, and the steadfastness of our people, the General Command of the Army and the Armed Forces announces the return of security and stability to Aleppo," said the statement read by an army general.

The statement said the victory in Aleppo is a "strategic transformation and a turning point in the war on terrorism and a deadly blow to the terrorist project and its supporters."

It is a further incentive, it added, to go on fighting to "eradicate terrorism and restore security and stability to every span of the homeland."

Syrian President Bashar Assad said earlier that his forces' achievements in Aleppo are a "major step on the road to wiping out terrorism" and should pave the way toward ending Syria's civil war.

Related: Aleppo Twitter Sensation Bana al-Abed Evacuated From Syrian City

The rebel evacuations were set in motion last week after Syria's opposition agreed to surrender its last footholds in eastern Aleppo. Since then, some 35,000 fighters and civilians have been bused out, according to the United Nations. The ICRC said in a statement that more than 4,000 additional fighters were evacuated in private cars, vans, and pick-ups from eastern Aleppo since Wednesday.

The departure of the last convoy paves the way for Assad to assume full control after more than four years of fighting over Syria's largest city. It marks his most significant victory since an uprising against his family's four-decade rule swept the country in 2011.

Thousands of civilians were evacuated from the besieged city in the last week as government forces sought to completely recapture Aleppo.

The U.N. estimates 1.3 million people were under siege by rebels or regime in 39 communities across Syria.