The last rebels were poised to leave the centre of the battleground Syrian city of Homs on Thursday, handing a symbolic victory to President Bashar al-Assad ahead of a controversial election.
Rebels hit back in the historic heart of Aleppo, blowing up a luxury hotel turned army position after tunnelling under the front line that divides the main northern city.
At least 80 percent of rebel fighters have already left the Old City of Homs under the unprecedented negotiated evacuation that began on Wednesday, provincial governor Talal Barazi told AFP.
The remaining 300-400 were due to leave on Thursday, Barazi said, although no evacuation buses had emerged by early afternoon.
The pullout from the city centre after a siege of nearly two years leaves the rebels confined to a single district in the outskirts of a city that what was for long an iconic bastion of the uprising.
Barazi said negotiations were well advanced for the rebels to leave that neighbourhood too in the coming weeks.
"Eighty percent of the rebels have left the city. The remaining 20 percent will leave on Thursday," Barazi told AFP.
"On Wednesday, 980 people left, the great majority rebels but some of them civilians, including women and children."
He said just 300 to 400 people now remained in the Old City and they too would be bussed out on Thursday to the opposition-held town of Dar al-Kabira, 20 kilometres (13 miles) north of Homs.
Barazi was able to visit his former office in the Old City on Thursday for the first time in three years.
It is not the first deal between the government and the rebels -- a number of ceasefires have been agreed in the outskirts of Damascus.
But it is the first time that rebel fighters have withdrawn from an area they controlled under an accord with the government.
The government allowed the remaining rebels in Homs to pull out with some of their weapons in return for the release of dozens of prisoners and hostages held by opposition fighters and the delivery of relief supplies to two pro-government towns in the north which they have besieged.
The negotiations were overseen by the ambassador of Syria's close ally Iran.
- 'Big game' -
Abu Wissam, one of the last rebel fighters awaiting evacuation from the city centre, bemoaned the outside interests now at play in a conflict that had begun as an Arab Spring-inspired protest movement.
"I took part in the protests from very early on. During that time, there were no international agendas controlling the protests. Everyone acted freely and spontaneously," he told AFP via the Internet.
"But now, everyone is moved like pawns in a chess game. The evacuation is a big game that has been in the planning" for many months by regional and international powers, he said.
There have been many sieges imposed by both sides in the three-year-old conflict but that of the Old City of Homs has been by the far longest.
Some 2,200 people were killed as near daily bombardment reduced the area to ruins.
The rebel pullout comes less than a month before a controversial presidential election, described as farce by Western governments and the opposition, that is expected to return Assad to office.
On a visit to Washington for talks with President Barack Obama, opposition chief Ahmad Jarba said the vote will give Assad "a licence ... to kill his own people for many years to come."
In Aleppo, the rebel attack completely destroyed the Carlton Citadel Hotel, just across the road from the city's UNESCO-listed Citadel, which the army had been using as a frontline position.
At least 14 soldiers and pro-government militiamen were killed in the explosion and its aftermath, the Britain-based Syrian Observatory for Human Rights said.
The Islamic Front, the largest rebel alliance in Aleppo, said it carried out the attack, which state television said also destroyed neighbouring historic buildings.
A rebel offensive in July 2012 in which they seized large swathes of Aleppo left the Citadel and nearby hotels which had once thronged with foreign tourists on the front line of the deadly conflict.