After four years of grueling bombardment and crippling siege, the remaining residents and rebels of a Damascus suburb agreed to surrender and evacuate under the terms of an agreement reached Thursday, Syrian government and opposition activists said.

The surrender of Daraya is a success for President Bashar Assad's government only a few miles from his seat of power, removing what has been a persistent threat to the capital and strategic military bases nearby.

Syrian state television said that under the terms of the agreement, 700 gunmen will be allowed safe passage out of Daraya to the northern province of Idlib. Around 4,000 women and children will be taken to shelters outside the town, the TV channel said.

Hussam Ayash, a Daraya activist and member of the town's local council, said a government delegation dictated the terms of the agreement to a committee negotiating on behalf of the town.

"No one will remain," he told The Associated Press from the town. "We are being forced to leave, but our condition has deteriorated to the point of being unbearable. We withstood for four years but we couldn't any longer," he said, in tears.

Daraya has been besieged and blockaded by government forces for nearly four years, with only one food delivery by the United Nations allowed to reach the district during this time. The town is southwest of Damascus and has been pummeled by government airstrikes, barrel bombs and fighting over the years.

Ayash said it became unbearable after the town's remaining field hospital was bombed and destroyed last week. The government had in recent months also encroached on the town's agricultural farms — the only source of food for the local population, which he estimated at 8,000.

The Britain-based Syrian Observatory for Human Rights also reported the agreement, under which rebels will give up all medium and heavy weaponry.

The U.N.'s humanitarian chief Stephen O'Brien told the Security Council earlier this year that severe food shortages were forcing some people in Daraya to eat grass. Residents had described burning plastic material to make fuel.

Ayash said the evacuation begins Friday, adding that residents have not been told where they would be taken.

The only guarantee the government offered is the local Red Crescent.

Daraya, which lies in the western Ghouta region, has suffered thousands of helicopter-dropped unguided barrel bombs over the years. It is the latest area to surrender to government troops following years of siege. Opposition activists and human rights groups accuse the government of using siege and starvation tactics to force surrender by the opposition.