More than 15,000 Turks, including judges, lawyers and students, marched in the Turkish capital Thursday to condemn an attack by a suspected Islamist gunman that killed a judge and wounded four others.

The gunman who opened fire on the judges inside Turkey's highest administrative court on Wednesday told authorities his attack was retaliation for a recent ruling against a teacher who wore an Islamic-style headscarf. Police captured him after the attack and on Thursday detained two other people for questioning.

Judicial officials, academics and secular Turks, carrying Turkish flags, marched to the mausoleum of Mustafa Kemal Ataturk, the founder of modern Turkey, in a show of loyalty to secularism Thursday. There they laid a wreath decorated with red and white carnations, the colors of the Turkish flag.

The march was broadcast live on several national televisions live. Some citizens were seen wiping tears from their eyes and kissing the marble stones of the mausoleum.

"Turkey is secular and it will remain secular," thousands chanted.

After the march, Turkey's top three courts, the Supreme Court, Council of State and Appeals Court issued a joint statement condemning the attack.

"This massacre attempt is directed against the secular republic. ... We strongly denounce it," said the statement read by Sumru Cortoglu. Thousands were also expected to attend the funeral of Judge Mustafa Yucel Ozbilgin, who was shot in the head by the gunman. Four other judges were also wounded in the attack and at least one was in an intensive care unit on Thursday.

Four of the judges — including Ozbilgin — had voted against promoting the teacher in February and the fifth had voted in favor.

The head scarf issue is a family matter for Erdogan's government. Erdogan's wife, Emine, wears a head scarf and Foreign Minister Abdullah Gul's wife, Hayrunisa, was barred from attending university for wearing a head scarf. The wives of most Cabinet members also wear head scarves and are also excluded from state functions and dinners by the pro-secular establishment.

The ban on head scarves on campuses and in state offices has been enforced vigorously since 1986 under the auspices of the military, which considers itself the guarantor of the secular constitution.

But the debate over the dress code dates to the days before Ataturk, who implemented Western reforms as he founded a modern, secular Turkey from the ashes of the Ottoman Empire in 1923.

Proponents of the dress code fear that if left unchecked, Islamic fundamentalism will lead to a theocracy like that in Iran under the Ayatollah Ruhollah Khomeini.