Turkey has detained 311 politicians, journalists, and activists for "spreading terrorist propaganda," or supporting anti-war movements as it bombs Syrian Kurds.

The Turkish Medical Association denounced the military campaign, saying "No to war, peace immediately," but Turkish Presdient Tayyip Erdogan denounced them as imperialists.

Turkey has jailed 50,000 since the July 2016 coup that failed as Erdogan consolodates power.

ANKARA (Reuters) - Turkey has detained more than 300 people for social media posts criticizing its military offensive in Syria, the government said on Monday, a day after President Tayyip Erdogan accused doctors who opposed the campaign of betrayal.

Since launching its 10-day-old air and ground offensive against the Kurdish YPG militia in Syria's northwestern region of Afrin, Turkish authorities have warned they would prosecute those opposing, criticizing or misrepresenting the incursion.

The Interior Ministry said on Monday a total of 311 people had been held for "spreading terrorist propaganda" on social media in the last 10 days. Detainees have included politicians, journalists and activists.

Turkey considers the U.S.-backed YPG, which controls Afrin, to be a terrorist group and an extension of the Kurdistan Workers Party (PKK) which has fought an insurgency in Turkey's largely Kurdish southeast since 1984.

The military operation has been widely supported by Turkey's mainly pro-government media and by most political parties, with the exception of the pro-Kurdish Peoples' Democratic Party (HDP). But there have been dissenting voices.

Over the weekend, Turkish media reported that 170 artists had written an open letter to lawmakers from Erdogan's ruling AK Party calling for an immediate end to Turkey's incursion.

Last week the Turkish Medical Association (TTB) denounced the cross-border operation, saying "No to war, peace immediately."

On Sunday, Erdogan accused the union of treason. "Believe me, they are not intellectuals at all, they are a gang of slaves. They are the servants of imperialism," he told AK Party members in the northern province of Amasya.

"This 'No to war' cry by this mob ... is nothing other than the outburst of the betrayal in their souls ... This is real filth, this is the honorless stance that should be said 'no' to," Erdogan said.

Deputy Prime Minister Bekir Bozdag said on Twitter on Saturday that the TTB and the Turkish Engineer and Architect Chambers Association (TMMOB), which has backed the medics, cannot use the word "Turkish" in their names, saying they did not represent Turkish medics, engineers and architects.

In a statement on Friday, the TTB said it rejected the accusations directed at it, adding remarks by senior government officials had made it a target of attacks. The Interior Ministry said later it had started an investigation into the association's actions.

Since a failed coup in 2016, Ankara has enforced a crackdown that saw more than 50,000 people jailed and 150,000 sacked or suspended from their jobs, including members of the pro-Kurdish opposition party. The government says the moves were necessary given the security threats Turkey faces.

Critics accuse the government of unjustly targeting pro-Kurdish politicians. Some lawmakers from the pro-Kurdish Peoples' Democratic Party (HDP) have been jailed on terrorism charges, which they deny.