BEIRUT — Syrian forces took full control of the final rebel bastion just outside Damascus on Thursday, the Russian Defense Ministry said, ending the bloodiest battle of Syria’s six-year war as rebels said a suspected chemical attack had forced their final withdrawal.

Douma, once famous as a symbol of peaceful resistance to Syrian President Bashar al-Assad’s government, fell first to hard-line rebels and then came under a crippling government siege before the Syrian and Russian militaries launched an all-out offensive to reclaim it.

On Thursday, Russian state television broadcast footage of the Syrian national flag being raised in the streets of the shattered city, marking a milestone in the Syrian government’s path to victory.

At least 1,700 people have been killed in the battle for Eastern Ghouta, of which Douma is the largest city. More than 151,000 people have left the wider area over the past month, according to the United Nations, most of them heading to Damascus, which is largely under government control.

The final straw came Saturday night when dozens were killed in the suspected poison-gas attack, according to local doctors, shattering the rebels’ resolve and prompting threats of military action by President Trump and European allies.

Negotiations for the withdrawal of Jaish al-Islam rebels had taken months, stalling and resuming as the fighting ebbed and flowed. “The chemical attack is what pushed us to agree,” Yasser Dalwan, a spokesman for the group, told the Agence France-Presse news agency. “Departures are ongoing.”

U.S. Ambassador to the United Nations Nikki Haley accused Russia April 10 of "protecting a monster over the lives of the Syrian people." (Reuters)

The Organization for the Prohibition of Chemical Weapons, a global watchdog, said Thursday that it had deployed inspectors to Syria and that they would start work Saturday. But the mission could face difficulties. Inspections in the wake of previous chemical attacks have faced restrictions by the Syrian government, former officials have said. 

Russian military police entered Douma on Thursday to act as “guarantors of law and order in the town,” the Russian Defense Ministry said, according to Russian news agencies. Russian troops had arrived Monday under the terms of a surrender deal reached with the rebels after the suspected chemical attack.

Russia and Syria insist there was no chemical weapons attack.

The Syrian Observatory for Human Rights, a Britain-based monitoring group, said Jaish al-Islam relinquished its weapons to government forces Thursday. In some cases, witnesses said, fighters emptied their magazines into the sky rather than hand over the ammunition, wounding residents in the area. 

“Victory in Ghouta is a critical point,” Bouthaina Shaaban, a senior adviser to Assad, told the Lebanese Al Mayadeen news channel. “It has sent a message to the whole world that Syria’s army and its allies can liberate every inch of Syrian territory.”

As the military operation draws to a close, the Syrian pound has risen, and residents of Damascus and Aleppo have celebrated in the streets. 

Thousands of rebels and civilians have been bused out of Douma in recent weeks under the terms of a Russian-brokered deal. For the activists and doctors who remained as the Syrian government reestablished control, an agonizing decision awaited.

A resident said Thursday that a group of doctors was expecting to be taken to a government facility the following day and asked to testify, in return for safe passage, that they had not witnessed a gas attack. He spoke on the condition of anonymity out of fear for his safety.

Another man, a student who also spoke on the condition of anonymity, described fears for the days to come. “Our nerves are frail. My head is going to explode,” he said. “I am afraid of this reconciliation. What if they don’t let me continue my studies?” His other option is to head north to Idlib, an opposition-held province dominated by hard-line rebels that could become the next focus of government attacks, or to brave a perilous journey with smugglers across the border to Turkey.

The student said he was living with a friend as they made their decision together. “I get really scared on some days, and he encourages me. On other days, he gets worried, and I encourage him,” he said. “We don’t know what to do.”

Although the exact circumstances of Saturday’s attack remain unclear, the World Health Organization said that at least 43 people were killed and about 500 others treated for “signs and symptoms consistent with exposure to toxic chemicals.” 

A network of local flight monitors said they tracked several helicopters heading southwest from a government air base Saturday evening. They said the same models of aircraft were then seen circling Douma at 7:26 p.m. and 7:38 p.m. Reports of the suspected gas attack began circulating minutes later.

In one apartment block, rescuers found rooms filled with tangled bodies and the stench of chlorine. Many had died foaming at the mouth, some of them embracing children.

Anton Troianovski in Moscow and Zakaria Zakaria in Istanbul contributed to this report.