The northern Syrian city of Aleppo was caught in a brutal four-year deadlock.
It was a key battleground in the war between forces loyal to President Bashar al-Assad and rebels who want to overthrow him.
In November, Syrian government forces launched a renewed assault, and rapidly retook almost all of the opposition-held east. By mid-December they had pushed the rebels into just a few neighbourhoods.
Tens of thousands of civilians fled those districts. The UN said it had received allegations that hundreds of men had gone missing since crossing into government-controlled areas - and that rebels prevented some civilians from leaving.
On 15 December, the warring sides reached an agreement to end the fighting, and on 22 December the government declared it had taken full control of the city following days of evacuations.
Why did both sides agree to a ceasefire deal?
The rebels had been rapidly pushed back into a small enclave, where, along with thousands of civilians, they came under intense bombing. The deal was negotiated between one of the rebels' key backers, Turkey, and Syria's ally Russia.
It follows a pattern of similar, local ceasefire and evacuation deals which have ended fighting in other besieged rebel-held parts of Syria, such as the Old City of Homs in 2014 and the Damascus suburb of Daraya this August.
Under the terms of the Aleppo deal, rebels and civilians were allowed to be evacuated to rebel-held Idlib province, while civilians in the rebel-besieged mainly Shia villages of Foua and Kefraya in Idlib were allowed to leave in return - at the insistence of Iran, sponsor of pro-government Shia Muslim militias fighting in Aleppo.
Why is Aleppo important?
Aleppo was once Syria's largest city, with a population of about 2.3 million. It was also the country's industrial and financial centre.
The old city is a Unesco World Heritage site and was famous for its 13th Century citadel, 12th Century Great Mosque and huge covered markets, or souks.
When the uprising against President Assad erupted in 2011, Aleppo did not see the large protests or the deadly violence that shook other towns and cities.
But it suddenly became a battleground in July 2012.
Rebel fighters launched an offensive to kick out government forces and gain control over northern Syria but the rebel assault was not decisive.
Aleppo ended up divided roughly in half - the opposition in control of the east, and the government the west.
Over the next four years, the battle for Aleppo became a microcosm of the wider conflict in Syria.
It highlighted the weakness of both sides, as well as the failure of the international community to protect civilians and broker a peace agreement.
Who has been fighting?
On the government side, state forces are being supported by Russian air strikes and Shia militias, including fighters from Iran, Iraq, Afghanistan, Lebanon and Pakistan.
The predominantly Sunni Muslim opposition is made of several rebel groups, many of whom have received financial aid from key opponents of President Assad, including the US, Saudi Arabia and Turkey.
Hardline Sunni Islamist groups are involved too, most notably Jabhat Fateh al-Sham, which earlier this year changed its name from the Nusra Front and announced it was cutting ties with al-Qaeda.
How the rebels have lost ground in 2016
4 Jan: At the start of the year, the rebels hold eastern Aleppo, linked to the border with Turkey via territory to the north and west. Turkey's government is a key backer of the rebellion against Mr Assad.
27 Jul: At the end of July, government forces surround the rebels, taking control of the strategically-important Castello Road in northern Aleppo, the only route into the rebel-held east. About 275,000 people suddenly find themselves under siege.
Early Aug: Rebels and al-Qaeda-linked jihadist fighters in the countryside outside Aleppo seize back control of a route through the Ramousseh district in the south of the city linking them up with the outside world again.
Mid-Oct: Government forces retake the area in early September and resume the siege. There is a brief pause in the offensive in mid-October to allow civilians and rebels to leave, but few take up the offer.
28 Nov: Syrian government forces recapture more than a third of rebel-held territory in eastern Aleppo. The rebels lose all of the northern neighbourhoods, leaving them with under two-thirds of the territory they had in the city.
6 Dec: Troops advance further, seizing more districts in the east. The gains mean the government has now recaptured more than 70% of the rebel-held area.
12 Dec: The Syrian army makes more gains, taking several districts, including the key Sheikh Saeed area, from the rebels, leaving them confined to a small enclave.
13 Dec: Following intense bombardment from pro-government forces, the rebels are squeezed into ever smaller areas of the city, retreating into just a handful of neighbourhoods.
15 Dec: A ceasefire deal is reached. Buses begin to take fighters, their families, and wounded people from east Aleppo to rebel-held areas in Idlib province. More buses are sent to evacuate residents of two villages, Foah and Kefraya, besieged by rebels in north-western Syria, as demanded by the government after an attempted deal the previous day collapsed.
22 Dec: Government declares full control over Aleppo for the first time in four years.
Syrian government forces launch their final push
After the government resumed its air campaign on 15 November, troops pushed into several northern Aleppo districts and forced rebels and jihadists to retreat southwards. Tens of thousands of civilians fled their homes.
By 13 December, more than 90% of the city had fallen to the government. The UN warned up to 100,000 people were trapped in "ever-shrinking" areas of eastern Aleppo, adding that rebels were stopping people from leaving.
Food and fuel in the rebel-held areas were running out, and basic infrastructure and health care facilities had been obliterated - at one point in November, all hospitals in eastern Aleppo were virtually out of action as a result of air strikes.
The UN says hundreds of civilians died, but the government and Russia denied targeting them. Rebel rocket and mortar fire has also killed dozens of people in the government-controlled west.
What does the recapture of east Aleppo mean?
With the rebels defeated in Aleppo, the government retook full control of the neighbourhoods they held, which means it once again holds the country's four largest cities.
President Assad may hope that the gains made in Aleppo will snowball into something more and help bring the civil war to an end.
But with rebel forces, jihadist groups and Kurds still controlling large parts of the country, there would still be a long way to go.
So there is a possibility that it may become a different type of war - with rebels not trying to hold territory and create their own entity but instead pursuing a hit-and-run insurgency.
Territory control across Syria and Iraq