Veteran Turkish politician Bulent Ecevit has had emergency surgery in hospital after suffering a stroke.
Bulent Ecevit helped push Turkey towards the West
Earlier on Thursday the 80-year-old had joined thousands of pro-secularist Turks at the funeral of murdered judge Mustafa Yucel Ozbilgin.
An Islamist gunman shot the judge dead and injured four others on Wednesday.
Mr Ecevit, who was prime minister five times, criticised the Islamic-rooted government over the murder, saying it was an act against the secular state.
The former Socialist prime minister was responsible for pushing Turkey closer to the West and towards candidacy for membership of the European Union.
But he was swept from power in 2002 after refusing to resign on health grounds.
Protesters held posters of Mustafa Kemal Ataturk and chanted slogans
This made way for the rise of current Prime Minister Recep Tayyip Erdogan's Justice and Development Party.
The attack in the Council of State courtroom is believed to have been linked to the court's record of strictly upholding the ban on Muslim headscarves in universities and government offices.
Mr Erdogan's government has been campaigning for the regulations to be relaxed or removed.
At the funeral at Ankara's main mosque on Thursday, many protesters chanted slogans calling for the government to resign, calling cabinet members a threat to the secular republic.
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".
Mr Ecevit is said to have suffered a stroke after returning home. Reports say he is now in intensive care.