The Syrian city of Homs, where the government was poised to retake control as rebels withdrew on Wednesday, is a pre-war economic hub whose strategic importance made it a key battleground.
The central city of some 800,000 people was one of the first to rise up against President Bashar al-Assad's rule when Arab Spring-inspired protests erupted in March 2011, prompting activists to dub it the "capital of the revolution".
But its strategic position commanding the main highway between Damascus and the Mediterranean coast made the government determined to recapture it as the protests turned into an armed rebellion.
Rebel-held areas of the city were subjected to devastating bombardment and nearly two years of siege that affected fighters and civilians alike.
Before the war the city was home to a patchwork of the different sects that make up Syria: 65 percent Sunni Muslim, 25 percent Alawite --- the minority community to which Assad belongs -- seven percent Christian and three percent Shiite and Ismaili.
As the conflict intensified, the differences became brutal faultlines and the city saw some of the worst sectarian killings of civilians anywhere in Syria.
In February 2012, the army surrounded the city's rebel-held Baba Amr neighbourhood and subjected it to massive bombardment until the rebels withdrew the following month in what was came to see as a turning point in the uprising.
From then on the conflict became increasingly militarised and brutal.
The army's recapture of Baba Amr left the district in ruins, a ghost town abandoned by most of its inhabitants. That pattern would be repeated in other majority Sunni neighbourhoods.
In November 2011, an AFP journalist saw the disfigured bodies of 80 people lain out in the mortuary of the city's general hospital.
Signup to our newsletter and follow us on Facebook and Twitter!
Some had been beheaded, their hands still tied behind their backs, others had been shot in the head or strangled.
They were Sunnis, Shiites and Alawites, all victims of sectarian killings who were murdered for having the wrong name or coming from the wrong part of the city.
The government was able to secure much of the city, but a few neighbourhoods, including the Old City and Khaldiyeh remained in opposition hands.
Then-provincial governor Ghassan Abdel Al set out the city's importance for the government in 2012.
"Whoever controls Homs controls Syria because the country consists of three links, the south, the north and the centre," he told AFP.
"Take what's in the middle and the necklace breaks apart."
In June of that year, government forces laid siege to the remaining opposition-held neighbourhoods, beginning a blockade that would last for nearly two years, the longest of any imposed in the country's conflict.
In late 2013, the army seized Khaldiyeh, but around 3,000 people remained trapped in the remaining rebel-held enclaves areas living in worsening conditions.
In the final months of the siege, activists reported food stocks running out and civilians and fighters alike surviving on wild plants.
In February 2014, a UN-Red Crescent operation evacuated around half of those trapped, with a deal for the withdrawal of the rest following in May.
With the departure of the rebels from the Old City and adjacent neighbourhoods, only the Waer district on the city's outskirts remains in opposition hands.
A similar evacuation is being negotiated there too and then the city will be entirely back in government hands.