ISTANBUL, Turkey -- In a landmark trial, scores of people -- including Turkey's former military chief, politicians and journalists -- were convicted on Monday of plotting to overthrow Prime Minister Recep Tayyip Erdogan's government soon after it came to power in 2002.

Retired Gen. Ilker Basbug was the most prominent defendant among some 250 people facing verdicts after a five-year trial that has become a central drama in tensions between the country's secular elite and Erdogan's Islamic-oriented Justice and Development Party.

The trial has sparked protests, and on Monday police blocked hundreds of demonstrators from reaching the High Criminal Court in Silivri, 40 kilometres (25 miles) west of Istanbul, in a show of solidarity with the defendants.

But Monday's verdicts were not expected to set off the kind of violent anti-government demonstrations that were recently sparked by a government plan to build a replica Ottoman-era barracks at a park near Istanbul's central Taksim Square.

In addition to Basbug, at least 18 other defendants were sentenced to life in prison, including 10 retired military officers and Dogu Perincek, leader of the left-wing and nationalist Workers Party. At least 64 other defendants received sentences ranging from a year to 47 years, according to state-run TRT television news.

At least 21 people were acquitted. The fully tally of verdicts and sentences was not immediately available.

The defendants were accused of plotting high-profile attacks that prosecutors said were aimed at sowing chaos in Turkey to prepare the way for a military coup. The prosecutions already have helped Erdogan's government reshape Turkey's military and assert civilian control in a country that had seen three military coups since 1960.

The trial, which began in 2008, grew out of an investigation into the seizure of 27 hand grenades at the home of a noncommissioned officer in Istanbul in 2007.

The defendants were accused of being part of an alleged ultranationalist and pro-secular gang called Ergenekon, which takes its name from a legendary valley in Central Asia believed to be the ancestral homeland of Turks.

In thousands of pages of indictments, prosecutors maintained that the gang was behind a series of violent acts, including one in 2006 on a courthouse that killed a judge. Prosecutors say that the incidents were made to look as though they were carried out by Islamic militants, in a bid to create turmoil and provoke a military intervention.

Prosecutors say the gang also plotted to kill Erdogan, Nobel laureate author Orhan Pamuk and other high-profile figures.

The defendants have rejected the accusations, and they are expected to appeal Monday's verdicts and sentences to the Court of Appeals in Ankara.

Representatives of Turkey's main pro-secular opposition party lashed out against the verdicts, accusing the government of influencing the justice system.

"A verdict that was decided five years ago was made public today," said Akif Hamzacebi, a legislator from the opposition Republican People's Party. "All principles of rights, justice, human rights, fair trial were trampled on here."

Peter Stano, spokesman for the EU's Enlargement Commissioner Stefan Fuele, said he would not comment on the specific rulings, but noted that the European Union has expressed concern before about defendants' rights in Turkey and indictments that are too general.

Prosecutors demanded life prison terms for 64 of the defendants, mostly on terrorism charges. Others were charged with possession of firearms or merely membership in Ergenekon.

Mehmet Haberal, a surgeon and founder of a university in Ankara, and Mustafa Balbay, the Ankara representative of pro-secular Cumhuriyet newspaper, both faced life prison terms but received sentences of 12 years and 34 years, respectively. The two men were elected to Parliament in 2011, while in prison, but were not able to take their seats. The court ordered Haberal released on time served because of health considerations.

Tuncay Ozkan, a prominent journalist who helped organize a series of anti-government protests in 2007, was given a life sentence.

The case has polarized the country between those who see it as an opportunity to unravel a shadowy network of ultranationalists known as the "Deep State" that allegedly acted behind the scenes with impunity, and those who believe it is a government attempt to muzzle Erdogan's secular-minded foes and undermine Turkey's secular legacy.

In a separate case, more than 300 military officers, including Turkey's former air force and navy chiefs, were convicted last year of other plots to bring down the government in 2003 and some were sentenced to 20 years in prison. Those verdicts are being appealed.