Demonstrators carry flags of the Yekineyen Parastina Gel, YPG, militia, as they protest against the Turkish military intervention in northern Syria, in Hannover, Germany, Saturday, March 17, 2018. (Ole Spata/dpa via AP)

ISTANBUL — Turkey's president said Sunday that allied Syrian forces have taken "total" control of the town center of Afrin, the target of a nearly two-month-old Turkish offensive against a Syrian Kurdish militia, which said fighting was still underway.

President Recep Tayyip Erdogan said the Turkish flag and the flag of the Syrian opposition fighters have been raised in the town, previously controlled by the Kurdish militia known as the People's Defense Units, or YPG.

"Many of the terrorists had turned tail and run away already," Erdogan said in the western province of Canakkale.

Turkey views the Kurdish forces in the Afrin enclave along the border as terrorists linked to the outlawed Kurdistan Workers' Party, or PKK, which has waged an insurgency within Turkey's borders for more than three decades.

Ankara launched an offensive against the town and surrounding areas on Jan. 20, slowly squeezing the militia and hundreds of thousands of civilians into the town center. At least 46 Turkish soldiers have been killed since then.

A Kurdish official, Hadia Yousef, told The Associated Press the YPG fighters have not fled the town, but have evacuated the remaining civilians because of "massacres." She said clashes in the town were still underway.

The Britain-based Syrian Observatory for Human Rights said the Turkey-backed forces have taken control of half the town, with intense fighting still underway.

The Observatory says nearly 200,000 people have fled the Afrin region in recent days amid heavy airstrikes, entering Syrian government-held territory nearby. Syrian State TV on Sunday broadcast footage of a long line of vehicles and civilians on foot leaving Afrin. Erdogan has said the people of Afrin will return.

Turkey's military meanwhile tweeted that its forces are now conducting combing operations to search for land mines and explosives.

The army posted a video on social media showing a soldier holding a Turkish flag and a man waving the Syrian opposition flag on the balcony of the district parliament building with a tank stationed on the street. The soldier called the capture a "gift" to the Turkish nation and to fallen soldiers on the anniversary of a famous World War I victory.

Footage by Turkey's private Dogan news agency showed Syrian fighters shooting in the air in celebration.

Kurdish news websites showed images of Syrian fighters destroying a statue symbolizing the Kurdish new year celebrations that are being held this week. The statue was of Kawa, a mythological hero in Iran's Zagros mountains who defeated a brutal ruler and lit fires to spread the news, ushering in spring.

The YPG has been a key U.S. ally in the fight against the Islamic State group, and seized large areas across northern and eastern Syria from the extremists with the help of coalition airstrikes.

But Erdogan has repeatedly said that NATO ally Turkey will not allow a "terror corridor" along its border.

Turkey also fears the establishment of a Kurdish self-ruled zone in Syria that could inspire its own Kurdish minority to press for greater autonomy. The Kurds are the largest stateless ethnic group in the Middle East, with some 30 million living in an area split between Iran, Iraq, Turkey and Syria.

The Kurdish militia and the Observatory said Turkish jets struck Afrin's main hospital on Friday, killing over a dozen people. The Turkish military denied the allegations.

AP