At a time when Turkey’s prosperity and its melding of democratic and Islamic values are being put forward as a model for an Arab world in turmoil, the country is facing its own internal power struggles — between Islamists and secularists, civilian leaders and military commanders. The outcome could not only determine the future of Turkey but, as it takes on a greater role in the affairs of the Middle East, also shape the region.

While many praise the diminished power of the military, critics say these struggles have also laid bare the deficiencies of Turkey’s democracy, pointing in particular to the Islamist-leaning government’s crackdown on dissent and the press — there are more journalists in jail here than anywhere else in the world. That has given rise to a chorus of frustration that was on vivid display in the streets Monday as Turkey celebrated its birthday.

In Ankara, the capital, thousands of secularist protesters clashed with the riot police after they went ahead with a rally to celebrate Republic Day, the holiday marking Turkey’s founding as a republic in 1923, that had been banned by the government of Prime Minister Recep Tayyip Erdogan, vaguely citing intelligence reports that the gathering could become violent.

“It is telling for the state of democracy when the right to celebrate the national holiday in one’s own peaceful way is strained,” wrote Yavuz Baydar, a columnist, in Monday’s edition of the daily newspaper Today’s Zaman.

Among the many changes brought about by the government of Mr. Erdogan, a pious Muslim whose rule has transformed Turkey’s economy but alienated the secular old guard, has been to decisively establish civilian control over a military that four times in the past 89 years has acted above the law to remove elected governments. In late September more than 300 military officers received prison sentences for conspiring to overthrow the government, in a trial known as the Sledgehammer case. The proceedings deeply polarized Turkish society, raised questions about the independence of the judiciary and seemed at times to rely on fabricated evidence. But the case represented a turning point in Turkish history by diminishing the power of the military, for decades the enforcers of secularism.