A Turkish court has jailed 337 former pilots and other suspects for life over a failed bid to oust President Recep Tayyip Erdogan, a court document obtained by AFP showed.

They were convicted of crimes including murder, violating the constitution and attempting to assassinate the president, according to the document provided by judicial sources before its official release.

More than 250 people were killed in the attempt to overthrow the government on 15 July 2016 when rogue soldiers commandeered warplanes, helicopters and tanks and sought to take control of key state institutions.

The state-owned Anadolu and other media said 25 F-16 pilots were given aggravated life sentences while four civilians were each given 79 life sentences.

Former air force commander Akin Ozturk and others at the Akinci air base near Ankara were accused of directing the coup and bombing government buildings, including parliament, and attempting to kill President Erdogan.

Families of the accused enter the Sincan Penal Institution at the 4th Heavy Penal Court near Ankara

The trial was the most high profile of dozens of court cases targeting thousands of people accused of involvement in the coup attempt, which Turkey blamed on supporters of the US-based Muslim preacher Fethullah Gulen.

The 79-year-old cleric, who was once an ally of Mr Erdogan and who denied any role in the coup, was one of six defendants, being tried in absentia.

A total of 475 people were on trial, 365 of them in custody.