ISTANBUL — The Turkish authorities briefly detained 27 scholars on Friday, accusing them of spreading “terrorism propaganda” and of insulting the state after they signed a petition denouncing the military’s campaign against Kurdish militants in southeastern Turkey.

Most of the scholars were from Kocaeli University in northwestern Turkey and were detained in early-morning raids on their homes, the semiofficial news agency Anadolu reported. By Friday evening, all had been released, according to Turkish news media reports.

All 27 scholars were among more than 1,000 academics from 90 Turkish universities who signed a public statement, “We Won’t Be a Party to This Crime,” that urged the government in Ankara, the capital, to end the “deliberate massacre” of Kurds caught in clashes between Turkish security forces and militants of the Kurdistan Workers’ Party, or P.K.K.

The petition angered President Recep Tayyip Erdogan, who denounced the group — and foreign scholars who signed the document, including the linguist and philosopher Noam Chomsky — in a televised speech on Tuesday. Mr. Erdogan accused them of “treason” and of forming a “fifth column” of foreign powers trying to undermine Turkey’s national security.