The longest, most divisive trial in modern Turkey's history has not yet drawn to a close but its verdict already has been rendered.
The five-year-long prosecution of 275 senior military officers, academics and journalists has humbled the country's once-mighty armed forces and left Recep Tayyip Erdogan, the country's Islamist-oriented Prime Minister, as, arguably, the most powerful Turkish leader since Mustafa Kemal Ataturk, founder of the modern state.
The Turkey over which Mr. Erdogan rules has greater political reach and economic clout than at any time since the Ottoman Empire.
Behind bars are the latest in a long line of military officers who effectively presided over Turkey for the past eight decades – men such as General Ilker Basbug, the former chief of staff, and various other heads of the army, air force and navy.
Some have spent years in prison just waiting for the trial to end; others beyond the current 275 defendants were convicted in various spinoff cases.
So many military commanders have been imprisoned that, at one point in the proceedings, M r. Erdogan himself worried that there were more admirals in jail than there were manning the fleet of this NATO power.
They have been charged with everything from plotting to overthrow the Erdogan government – controlled by the Justice and Development Party, or AKP, since 2002 – to carrying out most of the extra-judicial killings and bomb attacks that racked the country between 1980 and 2000. All this allegedly took place under the auspices of a secret paramilitary cabal known as Ergenekon (pronounced ahr-GEN-eh-kahn), named for an isolated valley in Central Asia said to be the birthplace of the Turkic people.
Starting out with widespread popular support, the Ergenekon prosecution and other similar investigations and trials constitute "a sustained and prolonged attempt to reduce the role of Turkey's military in the system," said Bulent Aliriza, head of the Turkey program at the Center for Strategic and International Studies in Washington.
And they have achieved that goal, he said. "The military is no longer the main arbiter of security, foreign policy and politics the way it was before."
Instead, power has shifted to the civilian government and Mr. Erdogan, who makes no secret of his desire to extend Turkey's economic and political influence throughout the region.
"The main purpose of all the trials is to sweep out the important figures (commanders, professors, journalists and other civilian activists) from public life who are the defenders of the Ataturk republic," said Oktay Eksi, a member of parliament for the opposition Republican Peoples Party (RPP) and former lead columnist with the Hurriyet newspaper. "When this cleansing has been accomplished, the next stage is to reshape the state as an Islamic republic," he added.
Long-time nationalists and supporters of the Ataturk model of a secular society dismiss the plot charges as fanciful. However, powerful secret societies such as the one in the alleged coup plot are nothing new to Turkey. The lineage of what is known as the "deep state" goes back to the late 19th century, when the so-called Young Turks masterminded a rebellion against the Ottoman emperor. At the end of the First World War, paramilitary groups were formed to resist Allied occupation; these would later be moulded by Ataturk into a fighting force that won Turkey's independence.
During the Cold War, with Turkey a founding member of NATO on the front line with the Soviet Union, similar groups were formed with Allied support to resist a feared Soviet occupation.
With the end of the Communist threat, however, these groups advanced other plans – some turned to crime, others formed death squads that were deployed against Kurdish separatists, Islamists, leftists and others seen as threats to Ataturk's republic.
Nobel laureate writer Orhan Pamuk, no friend of Mr. Erdogan's Islamic-oriented AKP, welcomed the Ergenekon investigation and trial when it started.
"The police informed me about the details of an Ergenekon plot to kill me about eight months before the Ergenekon investigation fully started," he said in a television interview in 2008. "Some papers understate this organization. I don't like talking about politics, but this is a reality. This organization exists. I have seen their plans; I have listened to their phone conversations about killing me."
Little was done about such groups until 2007, near the end of Mr. Erdogan's first term as Prime Minister. That was when General Yasar Buyukanit, Chief of the General Staff, tried to halt the AKP's growing power and made a clumsy attempt to prevent parliament from electing Foreign Minister Abdullah Gul as president.
He implicitly threatened "to stage a coup if the AKP pushed ahead with Gul's appointment," according to Gareth Jenkins, a Turkey analyst with the Silk Road Studies program at The Johns Hopkins University.
Mr. Gul became President, the position he holds today and, thanks to popular outrage over the meddling generals, the AKP won parliamentary elections that summer with an increased plurality, taking 47 per cent of the vote, up from 34 per cent in 2002.
"That's when the investigation and the trial really began," said Mr. Aliriza, adding that there was good cause to proceed against the armed forces leadership for contemplating a coup. "After all," he said, referring to the history of military coups in Turkey, "the military had done this four times before."
The trials, though, have taken on a life of their own. "It's time to bring it [the process] to an end," Mr. Aliriza added, for it may go too far and harm Turkey's interests. "But there is no clear end in sight."
Had the Ergenekon prosecution limited themselves to charges against the military and related death squads, it might have wrapped up the case long ago. But it continually widened the net. As Mr. Jenkins documents, prominent critics of the government found themselves arrested in the middle of the night and charged with membership in the cabal.
The trouble is, Mr. Jenkins wrote in a 2009 study, it had "no evidence that the Ergenekon organization it described even existed, much less that the accused were all members and engaged in a co-ordinated terrorist campaign to overthrow the government."
That would seem not to matter so much as the trial itself has brought the desired results.
Indeed, with the popularity of the AKP continuing to grow – it captured 50 per cent of the vote in 2011 – many Turks believe Mr. Erdogan is planning legislation to enhance the powers of the presidency, and will seek that office next year.
Such a move is hardly necessary, Mr. Aliriza said. "He is already, arguably, the strongest leader [of Turkey] since Ataturk himself."