A court in Turkey has sentenced retired military chief of staff Ilker Basbug to life in prison, and dozens of others including opposition members of parliament have received long prison terms, following a divisive trial of nearly 300 accused of seeking to overthrow the government.

At least 16 other defendants were sentenced Monday to life in prison, including 10 retired military officers, while 60 other defendants received sentences ranging from a year to 47 years, after being found guilty in the so-called Ergenekon conspiracy to overthrow the government of Prime Minister Tayyip Erdogan, according to state-run TRT television news.

Those getting prison terms, of between 12 and 35 years, include three serving opposition MPs from the Republican People's Party (CHP).

At least 21 people were acquitted.

Earlier, security forces fired tear gas in fields around the  courthouse in the Silivri jail complex, west of Istanbul, as defendants' supporters gathered to protest against the five-year trial, a landmark case in the decade-long battle between Erdogan and the secularist establishment.

Prosecutors say an alleged network of secular arch-nationalists, code-named Ergenekon, pursued extra-judicial killings and bombings to trigger a military coup, an example of the anti-democratic forces which Erdogan says his Islamist-rooted AK Party has fought to stamp out.

Government denies evidence fabricated

Ever since Erdogan's ruling Islamist-rooted Justice and Development Party (AK Party) came to power in 2002, tensions have been high with the army, which sees itself as a guardian of the secular state.

The prosecutions have helped Erdogan's government reshape Turkey's military and assert civilian control in a country that had seen three military coups since 1960.

Initially, the trial enjoyed broad popular support. It was seen as a way to end the military's meddling in politics. But concerns over the five years that the case took to be heard have steadily grown as the number of defendants, well-known critics of the government, increased.

There were also claims that much of the evidence was fabricated and that defendants were denied basic legal rights.

The government denies such charges and claims the case ushers in a new era of democracy. But critics point out that the case symbolizes the transfer of one authoritarian rule for another.

With files from Reuters and The Associated Press