In a case described as the most important in Turkey's history, two retired four-star generals went on trial yesterday at a high-security court outside Istanbul, charged with trying to overthrow the government.

For some, the arrest of the highest-ranking officers in Turkey's 63-year history of multi-party democracy is a critical blow against a once-untouchable military that has toppled four elected governments since 1960.

For others, the charges are an invention of the ruling AKP party to weaken the secular army and open the way for the country's Islamisation.

Download the new Independent Premium app Sharing the full story, not just the headlines

There are 56 defendants in the case, including journalists, university rectors and businessmen. Outside the courtroom in Silivri, hundreds of their supporters waved national flags and portraits of Ataturk, the secularist founder of modern Turkey. "The patriots are in prison," they chanted.

Inside, the mood was sardonic. "Silivri jail," one of the accused answered, when the judge asked for his address. Asked his occupation, a former mayor responded "professional criminal". One of the retired generals – Hursit Tolon – was in court, wearing a business suit and looking relaxed as he answered questions. The other – Sener Eruygur – did not attend because of his poor health.

In the 1,900-page indictment, prosecutors allege that the men are part of a group bent on triggering a coup against the Prime Minister, Tayyip Erdogan. Dubbed Ergenekon after a legend of Turks' Central Asian origins, the group formed in 2003, when the one-year-old AKP government pushed through laws to help the country's EU accession talks get under way.

It is alleged the group was unnerved by AKP's roots in political Islam and because its European-backed reforms undermined the army's traditional position at the centre of politics.

"We should have sorted this business out on 28th February, damn it," the indictment quotes one general as saying, referring to a 1997 coup. "There wasn't the EU then ... Now everything is much more difficult."

After the army chief of staff had blocked an alleged coup plot by top generals in 2003, prosecutors say, the conspirators changed tack, deciding to force military intervention by playing on the fear of Islam held by many Turks to destabilise the country. In May 2006, they ordered grenade attacks against a secularist newspaper. A fortnight later, a lawyer walked into one of the pillars of Turkey's secular establishment, the High Administrative Court and shot dead a judge.

Blamed at first on Islamists, the judge's murder sparked public outrage. At his funeral, angry crowds tried to beat AKP cabinet ministers. Within months, millions had taken to the streets to listen to calls from speakers, hand-picked by the No 1 suspect in yesterday's trial, for the military to intervene. In April 2007, it did, issuing a statement that forced early elections – which AKP won.

But in December 2008, the High Court of Appeals ruled that the murderer, who had been sentenced to life by another court, should be retried as a part of the Ergenekon investigation.

A lawyer for General Eruygur, the group's alleged leader, has described the charges against her client as "malicious lies". A secular opposition politician has compared the investigations to the 1979 Islamic Revolution in Iran.

Despite appearances, the investigation has been as much the result of co-operation between the military and the government as a clash: none of the officers charged with Ergenekon membership could have been arrested without the consent of the current chief of staff, Ilker Basbug.

Over the past month, however, that tacit entente has begun to crumble. At the end of June, after the publication of a document outlining another alleged military plot against the government, General Basbug complained of an "organised smear campaign" against the army. In another twist last week, pro-government newspapers claimed that members of a board responsible for appointing magistrates were trying to stifle ongoing investigations by removing prosecutors in charge of the Ergenekon case.

With frictions between state institutions rising, and the Ergenekon case coming to resemble a tug-of-war between factions united only by a questionable attachment to democracy, even supporters of the investigation are starting to fear it may do as much harm as good. Umit Cizre, an expert on civilian-military relations, noted: "There is nobody left to trust".