SINCAN, Turkey — When it began in August, the largest mass trial of those accused of masterminding last year’s failed coup in Turkey had all the signs of a show trial. Handcuffed prisoners were marched in a line to the court past a crowd of protesters calling for them to be hanged.

The hostility from relatives of people who died in the coup and supporters of President Recep Tayyip Erdogan remains, and frequently disrupts the proceedings. But the defendants — 481 servicemen and civilians — are finally being given a hearing at least.

The accused, more than 20 so far, present their own defense before a panel of three judges in a courtroom the size of a gymnasium. They read hourslong prepared statements and answer questions. Their lawyers are also given time to present a case.

They face a wealth of incriminating evidence — the indictment runs to 4,000 pages — and the charges include treason, murder and attempted murder in the bloody coup attempt in which 249 people were killed and more than 2,000 wounded. They risk lengthy sentences — one lawyer said his client faces 3,000 life sentences on multiple charges in three separate trials.