Syrian government forces raised a flag in the city of Homs as hundreds of exhausted Syrian rebels withdrew from their last remaining strongholds in the besieged city. The Free Syrian Army agreed to surrender to President Bashar Assad a bloodstained city that was once the centre of the revolt against him.

For Assad, it is a powerful victory ahead of presidential elections. For the rebels, the sad exit after two years of gruelling assaults and siege captures their sense of abandonment. "We ate grass and leaves until there was nothing left for us to eat," said opposition activist Abu Yassin al-Homsi. "We kept urging the international community to lift the siege but there was no response."

Photos show the scale of the destruction inflicted on Homs from months of bombardment. Buildings are shattered, streets are littered with burnt-out cars.

8 May 2014: Syrian government forces hang the national flag on top of a pole in the old city of Homs, following a negotiated withdrawal of rebel fighters.AFP
8 May 2014: Syrian government forces gather on a street in the old city of Homs, following a negotiated withdrawal of rebel fighters from the city centre where the opposition had held out under siege.AFP
8 May 2014: Debris blocks a deserted street in the old city of Homs after Syrian government forces regained control of rebel-controlled areas.AFP

The city quickly came under a series of crushing government offensives, turning it into a battleground that left entire blocks and much of its historic quarters in ruins. Thousands of people were killed and almost all its residents fled.

Rebels were slowly pushed back. For well over a year, government forces have been besieging rebels in around a dozen districts around its ancient bazaars. With food and medicine short, a first major group — around 1,400 people, including fighters and residents — evacuated earlier this year in a UN-mediated operation.

The last die-hards, including many from the al-Qaida-linked Nusra Front and other Islamic factions, held out for weeks. But they agreed to the cease-fire deal, which includes the release of captives held by rebels in Aleppo and Latakia provinces, and the easing of a rebel siege on two pro-government Shi'ite towns in Aleppo province in return for the safe passage out of Homs.

23 January 2012: A damaged armoured vehicle belonging to the Syrian army is seen in a street in Homs, ten months into the revolt against Assad's regime.Reuters
26 February 2012: Syrians attend a mass funeral for more than a dozen people, whom anti-government protesters said were killed during clashes with Syrian forces, at Khaldiyeh area in Homs.Reuters
2 May 2012: Syrian women walk past destruction in the Baba Amr neighbourhood of Homs. The head of the UN mission to Syria said his observers were having a "calming effect" on the ground but admitted the ceasefire was "shaky" and not holding.AFP
17 May 2012: Members of the Free Syrian Army take part in a military exercise inside a damaged and abandoned building in the Khaldiyeh area of Homs.Reuters
5 June 2012: A man sits on the balcony of his damaged house in Homs.Reuters
31 August 2012: A boy sits at his parents' house, damaged in shelling by forces loyal to Syria's President Bashar al-Assad.Reuters
4 September 2012: The damaged Im Al-Zinar church is seen in the old city of Homs.Reuters
1 November 2012: Damaged cars and buildings are seen in Juret al-Shayah in Homs.Reuters
19 November 2012: A man walks past a burnt car and damaged buildings along a street at the al Khaldiyeh neighbourhood of Homs.Reuters
man rubble
25 July 2013: People help a man after he was pulled out from under rubble at a site hit by what activists say was a missile attack from the Syrian regime in a besieged area of Homs.Reuters
29 July 2013: Damaged buildings flank the Khaled ibn Walid mosque in the district of al-Khaldiyeh in Homs.AFP
30 July 2013: Damaged buildings are seen along a street in the al-Khaldiyeh area of Homs.AFP
31 July 2013: Soldiers of the Syrian government forces patrol on a tank along a devastated street in the district of al-Khalidiya in Homs. The Syrian government announced the capture of Khaldiyeh, a key rebel district in Homs, Syria's third city and a symbol of the revolt against President Bashar al-Assad.AFP
19 August 2013: A man walks inside the damaged historical old souk of Homs.Reuters
1 January 2014: A boy rides on a tricycle along a damaged street in a besieged area of Homs.Reuters
rebels home
4 January 2014: Free Syrian Fighters rest in a safe house in the besieged city of Homs.Reuters
15 January 2014: Smoke and dust rise from buildings in Homs after what activists said was shelling from forces loyal to Syria's President Bashar al-Assad.Reuters
7 February 2014: Civilians carry their belongings as they walk towards a meeting point to be evacuated from a besieged area of Homs, in the the first stage of a planned three-day humanitarian ceasefire in the city which has suffered some of the worst devastation of Syria's three-year conflict.Reuters
9 February 2014: Civilians leave a besieged district of the city of Homs before being evacuated by UN staff to a safer location.AFP
9 March 2014: Damaged buildings dominate the skyline of Homs.Reuters
8 May 2014: Damaged and abandoned buildings are seen around a deserted square in the old city of Homs after Syrian government forces regained control of rebel-controlled areas. The last rebels were poised to leave the centre of the battleground Syrian city of Homs today, handing a symbolic victory to President Bashar al-Assad ahead of a controversial election.AFP

The evacuation caps a series of successes for Assad's forces. Backed by fighters from the Lebanese Shi'ite militant group Hezbollah, pro-government troops recently seized key territory in rugged mountains near the border with Lebanon and around the capital Damascus.

The government has control of almost all cities, as well as the recently-won Qalamoun region stretching north of Damascus to the Lebanese border and toward Homs. It also has a nearly unquestioned grip on the mountainous Mediterranean coastal region, the heartland of Assad's Alawite minority.

Still, Assad has lost huge territory to the opposition. Rebels hold the northern Aleppo province, much of neighboring Idlib province and the territory along the Turkish border, as well as the Raqqa region in the east — and Aleppo city, the country's largest city and former commercial hub, is carved up into rebel-held and government-held halves. Much of the rural areas in the south are highly contested, and rebels hold a number of surburbs ringing Damascus.