Tens of thousands of Turks have turned funeral ceremonies for a judge shot by a suspected Islamist gunman, into a mass show of support for secularism.
They waved Turkish flags and chanted for the country to remain secular on marches through the capital Ankara.
A man calling himself "a soldier of Allah" shot dead Judge Mustafa Yucel Ozbilgin and wounded four others at a top administrative court on Wednesday.
He was immediately arrested. At least three others have since been detained.
The attack is believed to have been linked to the court's record of strictly upholding the ban on Muslim headscarves in universities and government offices.
The government of Prime Minister Recep Tayyip Erdogan, which has Islamist roots, has been campaigning for the regulations to be relaxed or removed.
However, at the judge's funeral at Ankara's main mosque, many protesters chanted slogans calling for the government to resign, calling cabinet members a threat to the secular republic.
Ministers who attended the service were booed
Earlier, at least 15,000 protesters, from students to judges dressed in their robes, marched to the mausoleum of Mustafa Kemal Ataturk, the founder of modern, secular Turkey.
"Turkey is secular and will remain secular," many chanted, in a procession broadcast live on national television.
A wreath of red and white carnations, the colours of the Turkish flag, was laid at the mausoleum. Some protesters were tearful as they kissed the building's marble stones.
Thousands also went to pay their respects to Judge Ozbilgin, whose coffin was taken to the courthouse where the attack took place.
Key members of Turkey's secular establishment - including the Turkish chief of staff and top judges - stood around the coffin, which was draped in the Turkish flag and covered in flowers.
"Today we're sending a martyr to eternal life," Sumru Cortoglu, President of the Council of State, Turkey's chief administrative court, told the crowds.
Aslan Alpaslan reportedly shouted Allahu akbar as he opened fire
"The bullet that was fired into his brain was fired against the Turkish republic. But the life of people like him will help us keep the republic alive for ever."
The gunman reportedly burst into a committee meeting of the Council of State, shouting "Allahu akbar!" (God is great) as he fired his weapon.
The suspect has been identified as Aslan Alpaslan, 29. He was apparently carrying papers that identified him as a lawyer - although it is not known if these were genuine - and made it past security guards undetected.
Mr Erdogan was quick to condemn the attack, and said the culprit would be severely punished.
The semi-official news agency Anatolia says the four other judges injured in the attack are now in a stable condition.
The secular President Ahmet Necdet Sezer, who was applauded as he attended the funeral, warned that "no-one will be able to overthrow the [secular] regime".