Turkish President Tayyip Erdogan speaks during a meeting of the ruling AK Party in Ankara, Turkey January 26, 2018. Yasin Bulbul/Presidential Palace/Handout via REUTERS

ISTANBUL (Reuters) - A Turkish court on Wednesday sentenced 64 military academy officers and trainees to life in prison for involvement in a failed military coup in 2016, the state-run Anadolu news agency said.

Another 100 defendants were acquitted in the case, it said.

Those sentenced were involved with plotters of the coup and had flown unsuspecting military academy trainees to a military headquarters to confront civilians opposing the attempted putsch, Anadolu said, citing the indictment.

Four of the sentenced were given “aggravated life” sentences, the harshest punishment possible under Turkish law because it raises the minimum required for parole. The four were found guilty of attempting to overthrow the constitutional order.

More than 240 people, most of them unarmed civilians, were killed on the night of the July 15, 2016, when a group of rogue soldiers commandeered tanks and warplanes in an attempt to attack parliament and overthrow President Tayyip Erdogan.

Since the coup attempt, Erdogan has embarked on a sweeping crackdown, jailing some 50,000 people and sacking or suspending 150,000. Under the purge, Turkey shut down all of its military academies, schools that had been once seen as a pillar of the secular state.

The scope of the crackdown has alarmed European allies and rights groups, who fear Erdogan has used the coup as a pretext to quash dissent. Turkey says the measures are necessary, given the extent of the security threats it faces.

The government blames the network of Gulen, a former ally of Erdogan, for orchestrating the failed coup. Gulen, who has lived in self-imposed exile in Pennsylvania since 1999, has denied involvement and condemned the coup.