Residents of a blockaded rebel-held town near Damascus raised the flag used by the government of Syrian President Bashar Assad in a deal that sees them accept symbolic humiliation in exchange for food, activists said on Thursday.

The deal accepted by the town of Moadamiyeh is one of a number of short-lived, local truces reached between opposition-held towns and government forces in recent months, although the terms - which also included the rebels handing over heavy weapons and expelling outsiders - are unusual.

Residents described it as a bitter pill to swallow. For nearly a year, the sprawling community west of Damascus was shelled and starved, surrounded by government checkpoints that refused to allow through food, clean water and fuel, pressuring residents to expel anti-Assad rebels among them. At least two women and four children died of hunger-related illnesses by September, said activists.

The agreement also demanded rebels hand over their heavy weapons and that only registered residents of Moadamiyeh may remain in the town, in a condition likely to thin rebel ranks.

"There's sadness inside us, but we raised the flag because nobody helped us, nobody extended their hands to us," said a Moadamiyeh resident who identified only as Ahmad, fearing retribution from Syrian security forces. "We are ready to save the lives of (hungry) children. There's no bread in Moadamiyeh. For three months, there's been not even a grain of rice," he said.

The Syrian national flag of red, black and white stripes with two green stars could be seen from a distance flying over a water tanker, according to footage broadcast on a Lebanon-based news channel.

That flag is often associated with the ruling Baath party, and many rebels fighting Assad use a flag with green, white and black stripes and three red stars. Hard-line groups use a range of Islamic banners.

Syrian legislator George Nakhleh said that after the rebels hand over their heavy weapons, residents will establish local armed groups whose job will be to protect the town. He said the army will not enter the area but will guard it from outside.

"The army will protect Moadamiyeh but inside the town the residents will protect it. They will carry weapons and set up checkpoints to prevent the entrance of strangers who came from around the world to destroy our country," said Nakhleh in an interview with the Lebanon-based Al-Mayadeen TV.

He added that state institutions will gradually return to normal work and all gates will be opened in order for food and other stuff to enter the town so that life returns to normal.

The rebels have seized a ring of neighborhoods around the capital, a major front in the nearly 3-year-old civil war. Rebels often fire mortars at Damascus neighborhoods from the opposition strongholds, in explosions that have killed Syrian civilians and made life within the crowded capital dangerous and miserable. All of Syria's warring parties use blockades on civilians affiliated with enemy groups to punish their rivals.

The timing may be to bolster Assad's position ahead of internationally-brokered peace talks that are set for January.

Activists in Moadamiyeh had warned for months that malnutrition was rife among its estimated 8,000 civilians. They said children and the elderly have been badly affected and frequently fall sick with illnesses exacerbated by hunger.

The council spokesman, an opposition activist who goes by the nickname Qusai Zakarya, said the deal allowed for the daily, limited entry of food, ensuring that residents could be quickly blockaded again. But Zakarya and activist Ahmad said no food had entered the town so far.

Zakarya said it was likely because government officials wanted a military committee to sweep through Moadamiyeh to seize any heavy weapons.

In the fall, a similar series of truces allowed some 5,000 residents of Moadamiyeh to flee the town.

The Western-backed exiled opposition group, the Syrian Coalition, said the deal demonstrated how Assad's government used "food as a tool of war."

Also in the northern Syrian city of Aleppo on Thursday, rebel gunmen stormed the anti-Assad Shatha television channel, seizing seven activists and shooting another, seriously wounding him, said the British-based Syrian Observatory for Human Rights and another activist group, the Aleppo Media Center.

It was not immediately clear why the anti-Assad activists were seized. However, hard-liners have abducted and killed activists in the past, hoping to silence their criticism of rebel abuses.

The war has seen Syria's rebel movement fragment into a wide range of groups. Hard-liners, some affiliated with the extremist al-Qaida group, have become increasingly prominent.