ISTANBUL (Reuters) - A Turkish court ruled on Friday that four prominent members of an opposition newspaper must remain in detention but freed seven others for the duration of the trial, in a case seen by critics of President Tayyip Erdogan as an attack on free speech.

Since the first hearing in the case on Monday, hundreds of people have protested outside the central Istanbul court against the prosecution of 17 writers, executives and lawyers of the secularist Cumhuriyet newspaper.

The court remanded in custody the chairman of Cumhuriyet’s executive committee Akin Atalay, its chief editor Murat Sabuncu, and reporters Kadri Gursel and Ahmet Sik until the next hearing on Sept. 11, citing the gravity of the charges they face.

Chief judge Abdurrahman Orkun Dag freed seven others until the next hearing on “judicial probation” - meaning they cannot leave the country and must report regularly to a police station.

Turkish prosecutors are seeking up to 43 years in jail for the newspaper staff, who stand accused of targeting Erdogan through “asymmetric war methods”.

The 324-page indictment alleges Cumhuriyet was effectively taken over by the network of U.S.-based cleric Fethullah Gulen, who is blamed for a failed coup last July, and used to “veil the actions of terrorist groups”.

Cumhuriyet says the charges are “imaginary accusations and slander”.

Slideshow ( 6 images )

“THEY’RE TELLING US TO KNEEL”

Gursel, along with Sabuncu and other senior staff, has been in pre-trial detention for more than 260 days.

“They’re telling us to kneel. Members of this rotten entity, with its gunmen and tyrants who lack honor, should know very well that until today I’ve only kneeled before my mother and father, and will never ever kneel before anybody else,” Sik told the crowded courtroom.

The court ordered an investigation into Sik, who once wrote a book critical of Gulen’s movement, for comments he made during his defense.

Social media posts comprised the bulk of evidence in the indictment, along with allegations that staff had been in contact with users of Bylock, an encrypted messaging app the government says was used by Gulen’s followers.

Following Friday’s ruling, lawyers marched outside the courthouse, chanting “right, law, justice”, as armored police vehicles and officers stood with tear gas and automatic weapons.

Slideshow ( 6 images )

Former chief editor Can Dundar, who is living in Germany, is being tried in absentia, and the court said an arrest warrant for him remained in force.

Rights groups and Turkey’s Western allies have complained of deteriorating human rights under Erdogan. In the crackdown since last July’s failed coup, 50,000 people have been jailed pending trial and some 150,000 detained or dismissed from their jobs.

In a joint statement, several international observers, including Reporters without Borders, called for the release of all 17 defendants, saying the case amounted to a “politically motivated effort to criminalize journalism”.

During Turkey’s crackdown, some 150 media outlets have been shut and around 160 journalists jailed, the Turkish Journalists’ Association says.

Authorities say the crackdown is justified by the gravity of the coup attempt, in which rogue soldiers tried to overthrow the government, killing 250 people, mostly civilians.