Turkish-backed Syrian rebels seized control on Sunday morning of the city of Afrin, the target of a two-month military operation against Kurdish militias in the enclave in Syria. The takeover dealt a blow to Kurdish inclination for self-administration there and added to Turkey’s growing footprint in the country.
The Syrian rebel forces, which have served as advance troops for the Turkish operation, seemed to have entered the city without a fight, after the Kurdish People’s Protection Units, or Y.P.G., withdrew to the surrounding hills. But residents described chaos as fleeing civilians were trapped by artillery and by Turkish airstrikes.
The seizure of Afrin, a mainly Kurdish city near the Turkish border, came as other Syrian rebel groups came close to collapse in the besieged enclave of eastern Ghouta, in the suburbs of Damascus. Syrian forces have split the enclave into three components under a blistering barrage of ordnance and airstrikes.
On Sunday, President Bashar al-Assad was photographed visiting troops near the front line.
The Y.P.G. denied that the city had fallen and said that fighting was continuing. But a growing number of witness accounts and social media posts indicated that the Free Syrian Army had entered.
“Afrin is free!” Hussein Ali, 23, a fighter with the Free Syrian Army, shouted with excitement when contacted by telephone. “It was cleared early today. Kurdish fighters pulled out toward the surrounding mountains, and they’re still sniping at us.”
Debates were underway between Ghouta’s two main rebel groups and Syrian and Russian officials, which could lead to some fighters being evacuated to rebel-held areas in the north. Some 20,000 civilians have already fled to government-held areas.
But a coalition of civilian groups, saying that their concerns needed separate representation, called for guarantees of safety for medical workers, civilian activists and others who could face arrest by government security forces, amid reports that some of those fleeing had been detained.
In recent days, doctors in Ghouta have described desperate scenes as families trying to flee were bombarded by government warplanes, drones and artillery, leaving the wounded — including women and children — lying in the street and cut off from medical care.
In Afrin, too, tens of thousands of civilians have fled in recent days, as Turkish troops encircled the city but left a corridor open to the south.
A unit of the rebel force, which comprises several groups that fight under the banner of the Free Syrian Army, posted video of its fighters strolling through the empty streets between deserted high rises. “The Syrian National Army inside Afrin city,” one of them says to the camera.
President Recep Tayyip Erdogan of Turkey announced the takeover of the city in a speech at a commemoration ceremony in Gallipoli on Sunday, hailing the Turkish and Syrian soldiers who had accomplished the takeover as heroes.
“This morning at 8.30 a.m., Afrin city center was completely taken under control by F.S.A. members, who are supported by our Turkish military,” he said. “The majority of terrorists had already escaped, their tails between their legs.” Turkish special forces were assisting in clearing mines and weaponry left behind, he added.
The operation was a turnabout for the Syrian fighters, who had originally taken up arms to fight their government and are now fighting Syrian Kurds who had sought a measure of autonomy in Syria. Turkey, one of the main backers of Syrian rebels, has shifted its focus to preventing the Y.P.G., which it considers a terrorist organization, from establishing a foothold along its border. It has enlisted rebels, including some displaced from their homes by the Y.P.G.
The events have fueled fierce controversy among Syrian opposition activists, with some saying that Syrian rebels were working for Turkey against other Syrians. Even some members of the Turkish-backed rebel force expressed ambivalence, with one fighter saying on the eve of the battle that the revolution had gone off course.
But others argue that Turkish protection is the best bet for establishing areas free of government control and bombing.
The Turkish military released footage of a soldier hanging a Turkish flag from the first-floor balcony of the governor’s office in Afrin, as a fighter next to him waved a Syrian opposition flag.
Mr. Erdogan vowed to rebuild the region to permit citizens to return.
“We will take all types of steps for people of the region currently living in our country and other places to turn back to their homeland, houses as soon as possible,” he said.
The procedure appeared to be starting in the southern Turkish city of Gaziantep on Sunday as Syrian opposition leaders and activists from Afrin collected at a hotel to select council members to run an administration in the city, including policing arrangements.
Arabs, Kurds and other minorities, including Yazidis, Alawites and a Christian from Afrin, took part in the council meeting, which was closed to the news media. Many had taken refuge in Turkey in recent years because of their opposition to the Y.P.G., and 15 people had also traveled from Afrin for the meeting, organizers said.
Turkish officials will post Turkish troops and Free Syrian Army fighters to protected the wider region but intend to leave the internal security of the city to the local police, according to Abdolaziz Tammo, the Kurdish politician who organized the meeting. He is the head of the Syrian Kurds Independent Association.
Mr. Tammo has been campaigning for Syria’s Kurds to break free of the Kurdistan Workers’ Party, or P.K.K., and its affiliate, the Y.P.G.
Mr. Tammo said he blamed the Syrian government and the P.K.K. for collaborating in the assassination of his brother, the politician Michel Tammo, in 2012.
“This is a liberation,” Mr. Tammo said of the departure of the Kurdish militias from Afrin. “They took control by force of arms and forced the people to live under their rule.”
Representatives of the Y.P.G. militia contended that the takeover of Afrin was an attempt to drive Kurds from the area. Asya Nebi, a representative of the militia, said civilians trapped in Afrin had been hit by warplanes and artillery as they tried to escape through the southern corridor. She said 500 civilians had been killed in the fighting and 1,000 others had been wounded.
Mr. Ali, the Free Syrian Army fighter, said that many of the Kurdish troops had abandoned their guns. “The fighters left their weapons behind,” he said. “We found many on the ground and in the trash.” But he said five of his comrades had been killed by land mines.
Mr. Ali vowed to continue the fight to his hometown, Manbij, where American forces are based and where they have been working alongside Y.P.G. forces to defeat Islamic State militants in Syria.
Other rebel fighters posted photographs of their units, holding the opposition Syrian flag aloft, at the main intersections and before a statue on Afrin’s central square. Later, photographs showed that the rebels had toppled the statue of Kawa the Blacksmith, a figure from Kurdish and Persian mythology who is celebrated on March 21, the time of the Kurdish New Year.
Discussions erupted on social media over why the Free Syrian Army had felled the statue. Some said that the fighters possibly thought it represented the Kurdish leader of the P.K.K., which is designated a terrorist group.
Video also circulated on social media of residents of the city emptying the former stores of the Kurdish militias. One man carried a sack of grain away on his shoulder, and women rushed back and forth piling up food in the courtyard.