Lawyers and media members wait to enter a courthouse in Silivri, Turkey, where a hearing on people charged with attempting to overthrow Prime Minister Tayyip Erdogan's Islamist-rooted government is due to take place, August 5, 2013.

The behemoth, years-long Ergenekon case, which involved almost 300 defendants – including generals, academics, journalists, and known criminals – came to a close today as a court handed down verdicts.

The Ergenekon case, based on an alleged conspiracy to topple the government, has divided Turkish society, with critics condemning the trial as a politically motivated attempt by the governing Justice and Development Party (AKP) to stifle dissent.

Out of the 275 defendants, only 21 were acquitted of the charges against them. Others received sentences of up to 20 years, reports Al Jazeera. İlker Başbuğ, the former chief of Turkey’s armed forces, has been sentenced to life in prison, while many other well-known defendants have yet to be sentenced.

Verdicts were handed down in the courthouse at the Silivri Jail Complex, where the trial has been ongoing for five years. Security was tight, and police and other security forces set up barricades around the courthouse in anticipation of protests. Tear gas was fired at those who arrived to demonstrate against the proceedings.

The case has cast a shadow over Turkish political life since it began in 2007, when police forces discovered explosives after a raid on a house in Istanbul, writes the Telegraph. Since then it has spiraled into a wide-reaching conspiracy investigation of “Ergenekon,” a ring of arch-nationalists plotting to overthrow the government in a coup reminiscent of those that plagued Turkey throughout the 20th century.

Those who are sympathetic to Prime Minister Recep Tayip Erdogan and the AKP government see the verdict as a victory for the democratic process and a defeat for the military and other shadowy forces that have controlled Turkey’s political fate for decades, reports the BBC. The military, which has long seen itself as the protector of Turkey’s secular heritage, overthrew the government three times between 1960 and 1980, and has historically had antagonistic relationships with Islamic-oriented parties such as the AKP.

Critics, including the main opposition party, have said the charges are trumped up, aimed at stifling opposition and taming the secularist establishment which has long dominated Turkey. They say the judiciary has been subject to political influence in hearing the case.

"This is Erdogan's trial, it is his theatre," Umut Oran, a parliamentarian with the opposition [Republican People’s Party (CHP)], told Reuters.

"In the 21st century for a country that wants to become a full member of the European Union, this obvious political trial has no legal basis," he said at the courthouse.

Several CHP officials were convicted during the trial, including Deputy Mustafa Balbay, who received 34 years and eight months in prison, reports Hurriyet Daily News. Others convicted include journalist Tuncay Özkan and Workers’ Party leader Doğu Perinçek, who received aggravated life sentences with an additional 16 and 30 years in prison, respectively.

Mr. Erdogan has come under heavy criticism after violent crackdowns on protesters this summer. The protests began as a demonstration against the destruction of a city park, but quickly transformed into a mass outcry against what are seen as his heavy-handed tactics, writes The Christian Science Monitor.

“His critics find him intolerant of opposing views,” says Fadi Hakura, a Turkey expert at the Chatham House think tank in London. “He definitely is pushing Turkey toward social conservatism, a euphemism for increasing restrictions on lifestyle choices such as alcohol, access to abortion rights, and how women and men act in the public space.”

The Ergenekon trial is the second in recent years to target Turkey’s military. The first, dubbed “Sledgehammer,” ended last year with the conviction of approximately 330 military officers, effectively ending the armed forces’ role in Turkish politics, reports Bloomberg. Both cases have been scrutinized by observers for a lack of fairness and the possibility of political motives.

“The judiciary appears dominated by Erdogan’s appointees, the press practices a considerable degree of self-censorship,” Andrew Mango, author of seven books on Turkey, said in an e-mail on June 12. “If his own party does not restrain him, it is difficult to see who and what group will.”