A Turkish court has begun delivering its verdicts in the trial of 275 people accused of plotting to overthrow the government, sentencing a former army commander to life in prison.

General Ilker Basbug, who led Turkish armed forces from 2008 to 2010, denies all the charges against him.

At least 21 defendants were acquitted, while several others were sentenced to lengthy jail terms.

Three former opposition lawmakers were sentenced to between 12 and 35 years in prison.

The verdicts were being announced individually.

Among the defendants in the high-profile case are generals, lawyers, academics, and journalists.

The charges include membership in an alleged "terrorist organization" known as Ergenekon, as well as arson, illegal arms possession, and instigating an armed uprising against Prime Minister Recep Tayyip Erdogan and his Justice and Development Party (AKP).

Riot police have been deployed and metal barriers set up around the courthouse in Silivri, near Istanbul.

Police used tear gas to disperse hundreds of protesters who attempted to march on the courthouse.

Demonstrators chanted, "We are soldiers of Mustafa Kemal" in a reference to Ataturk, the founder of modern Turkey.

Turkey's secular opposition has denounced the trial, which began in 2008, as a witch hunt aimed at silencing government critics.

The staunchly secular Turkish military, which has long been seen as the guarantor of the country's constitution, has a history of tension with the Islamist-rooted AKP.

The military staged three coups in Turkey in 1960, 1971, and 1980. In 1997, it forced the resignation of the first Islamist-rooted Turkish government led by Erdogan's mentor, Necmetin Erbakan.

Hundreds of military officers have been arrested since Erdogan came to power in 2002 in what critics said was a crackdown on the army's influence in the country's politics.

In September 2012, in a separate case dubbed Sledgehammer, the court in Silivri sentenced more than 300 serving and retired army officers to sentences up to 20 years imprisonment on charges of plotting to overthrow the government a decade ago.