An attack on Turkey's top administrative court has brought to the surface simmering tensions between secularists and Turkey's governing Justice and Development Party, which has Islamist roots.
Turkish media have described the gunman as an Islamist and the incident is being linked to a court ruling earlier this year barring a teacher from promotion because she wore a headscarf.
Many protesters felt Turkey's secular heritage had been attacked
Wednesday's attack, in which one judge was killed and four others injured, has become a rallying point for Turkish secularists - one columnist referred to it as "Turkey's September 11th".
The country's President, Ahmet Necdet Sezer, himself a former judge, described it as "an attack on the secular republic".
Many thousands of people came onto the streets of Ankara to mourn the murdered judge and defend the country's secular constitution.
Government ministers attending the funeral were met with chants of "murderers out" and calls for their resignations.
The country's powerful military, which regards itself as the guardian of Turkey's secular state, turned out in force.
Cabinet ministers at the funeral were heckled by protesters
The shooting has brought to the surface simmering tensions between the overwhelmingly Muslim, but staunchly secular, Turkish establishment and the governing Justice and Development Party.
Secularism is the cornerstone of the modern Turkish state, which was founded in 1923 by Mustafa Kemal Ataturk.
However, political Islam has been on the rise in Turkey over the past decade.
Members of the secular establishment have long been suspicious of the Justice and Development Party's leader, Recep Tayyip Erdogan, who once served a jail term for reciting an anti-secular poem.
Despite his insistence that his party has changed, they allege it has not entirely shaken off its Islamist roots and accuse it of quietly trying to put religion at the heart of Turkey's government and society.
Opposition politicians also accuse the government of encouraging this week's attack on the court by criticising that court's earlier ruling on the headscarf ban.
The ban has become the symbol of deep divisions over the role of religion in Turkey.
Women are not allowed to wear headscarves in government buildings, schools, universities or at public ceremonies.
That has led to rows in the past, for instance when the staunchly secular president refused to invite any headscarf-wearing wives of top officials, including Mr Erdogan's, to an official reception.
The press has said the gunman was an Islamist
Many secular Turks regard the headscarf as a threat - a symbol of radical Islam.
Mr Erdogan has made it clear that he would like to see the ban overturned, something which would be welcomed by his party's religious grassroots.
However, he has made no real move to do so, perhaps realising that this would prompt a major confrontation with the secularist establishment.
This includes the army, which mounted three coups between 1960 and 1980 and, less than a decade ago, helped to ease Turkey's first Islamist prime minister from power.
The fact that the attack on the court is being linked to the headscarf issue has re-opened old political wounds.
They may be difficult to heal, particularly with another possible flashpoint between the Justice and Development Party and secularists looming next year - the election of a new president to replace Mr Sezer.