SILIVRI, Turkey (Reuters) - The first criminal trial related to a summer coup in Turkey started on Tuesday as 29 police officers faced sentences of up to life in prison on charges of involvement in the failed attempt to overthrow the government.

Some 40,000 people have been arrested since the July 15 putsch, which killed around 240 people, in a crackdown targeting the military, police, civil service and private sector. More than 100,000 have been sacked or suspended.

The officers face a range of charges, according to a copy of the indictment obtained by Reuters. Some are accused of attempting to overthrow the constitutional order, and others of membership of a terrorist organisation.

They include three police helicopter pilots accused of disobeying an order to take special forces to defend President Tayyip Erdogan’s mansion in Istanbul.

Two defendants who testified during the morning session both denied the charges against them. Lawyers for the other 27 defendants could not immediately be reached to say how their clients would plead.

“Everyone involved in the coup attempt must have a fair trial,” Orhan Cagri Bekar, a lawyer who represents an association for coup victims, told reporters. “Those who are guilty must be sentenced to the heaviest punishment because this is a betrayal of the country.”

Prosecutors are seeking life sentences for 21 of the policemen and sentences of between 7-1/2 to 15 years for the other eight, state-run Anadolu Agency said.

Security was tight at the courthouse in Silivri, west of Istanbul. Attendees were not allowed to bring recording devices into the building and the gallery was only partly full.

“There are very few relatives, this is because there is a climate of intimidation,” said one man, a relative of one of the accused, who declined to be identified.

“Had there been any democracy then these people would not have been so scared to own up to their own children.”

SOLDIERS AND TANKS

On the night of the coup, rogue soldiers commandeered tanks, helicopters and warplanes in Istanbul and Ankara, attacking parliament and other institutions. Their efforts failed after thousands of Turks took the streets and faced them down in response to calls from Erdogan.

Some of the police officers had the ByLock app on their smartphones, according to the indictment. The government says that coup plotters used the little-known messaging app to communicate.

Prosecutors also allege one officer had messages on his phone telling him and others to post messages on social media condemning the coup and to “act normal” to avoid detection.

The coup’s alleged ringleaders are due to go on trial in Ankara, probably next year. The government said earlier this year a new court would be built there as there were none big enough to handle such a large number of defendants.

The government has blamed a U.S.-based Muslim cleric, Fethullah Gulen, for orchestrating the failed coup. Gulen, a former ally of President Erdogan, has denied the allegation and condemned the coup.