* Nearly 300 accused of seeking to overthrow government
* Erdogan says he is fighting anti-democratic forces
* Critics say trial aimed at stifling opposition (Adds details from courtroom)
By Ece Toksabay
SILIVRI, Turkey, Dec 13 (Reuters) - Turkey's former armed forces chief stormed out of a courtroom near Istanbul on Thursday in protest at the handling of a trial of nearly 300 people charged with attempting to overthrow Prime Minister Tayyip Erdogan's government.
General Ilker Basbug, along with politicians, academics, journalists and other retired army officers, is on trial on suspicion of belonging to a shadowy underground network of ultra-nationalists called "Ergenekon".
The alleged group is accused of orchestrating decades of political violence, extra-judicial killings and bomb attacks, and most recently of trying to topple Erdogan.
Basbug, the highest-profile defendant, walked out after prosecutors tried to add two additional indictments at the last minute despite protests from defence lawyers.
Outside, thousands of Turkish secularists protested against the trial, denouncing it as an attempt by Erdogan's Islamist-rooted government to stifle secularist dissent.
Security forces wielded batons and fired pepper spray to keep crowds behind barricades at the prison complex, where dozens of the defendants have been in jail for much of the four-year trial.
Rivalry between religious and secular elites is one of the major fault lines in Turkish public life. The case is emblematic of Erdogan's long-standing battle with secularist opponents, and one of a series of conspiracy trials that he describes as a struggle against anti-democratic forces.
Basbug's exit underscored the frustrations of a military elite, long the self-appointed guardian of Turkish secularism, that has been emasculated under Erdogan's rule.
Judges called a series of recesses in the packed and noisy court as they clashed with defence lawyers, who complained they were being denied the right to challenge court procedure.
State prosecutors had been expected to present their final statements but the chief judge ordered the reading of two additional indictments, adding to more than 20 already incorporated into the case and prompting further delays.
"TURKEY IS SECULAR!"
Erdogan's critics say the trial is part of efforts to stifle opponents of his AK Party (AKP), whose strong strain of religious conservatism they see as undermining Turkey's secular foundations. There were calls for the government to resign among slogans chanted by the crowds.
"Turkey is secular and will remain secular!", "The AKP will have to answer to the people!", "Shoulder-to-shoulder against fascism!", chanted the crowds.
They were largely made up of members of the main opposition CHP, a smaller left-wing party whose leader is one of the defendants, and secularist associations.
Many in the crowds waved Turkish flags and pictures of Mustafa Kemal Ataturk, who founded a modern, secular Turkish republic from the ashes of the Ottoman Empire in 1923.
During his decade in power, Erdogan has transformed Turkey, creating a thriving economy and taming a powerful military that had ousted four governments in recent decades.
But the Ergenekon case and other conspiracy trials have drawn accusations of political influence over the judiciary, with the CHP describing them as an "Inquisition" against opponents of the government.
"These courts are like Russian dolls. They may look like different cases and different courts, but they are all the same. They are carrying out a political mission," CHP deputy leader Umut Oran, who was attending the hearing, told Reuters.
Some 50 members of parliament, mostly from the CHP, were attending the hearing, along with around 200 lawyers.
The 275 defendants, 66 of them in custody pending a verdict, include two deputies from the CHP. Once prosecutors have summed up their case, the defendants will have a right to a final statement which, given their numbers, could still take months. (Writing by Daren Butler; Editing by Nick Tattersall and Kevin Liffey)