(Adds details, quotes, background)
By Selcuk Gokoluk
ANKARA, July 6 Two former Turkish generals were arrested on Sunday on charges of forming and leading a terrorist group and seeking to overthrow the Islamist leaning government, the state Anatolian news agency said.
A court ordered the arrest of Sener Eruygur, once head of the paramilitary gendarmerie, and Hursit Tolon, the former first army commander. They were sent to a prison in Istanbul.
Eruygur is head of the Kemalist Thought Association, which helped organise mass anti-government demonstrations last year.
They were among 21 people detained last Tuesday in a police investigation into allegations of a coup. Eight of the detained including a prominent businessman had already been arrested.
Media reports said a secret plan was seized during the swoop which called for illegal protests on July 7 across 40 provinces, assassinations and attacks on security forces.
Media said the two former generals were suspected of being members of a shadowy, ultra-nationalist secularist group known as Ergenekon, which was already under investigation.
Turkey, predominantly Muslim but officially secular and seeking to join the European Union, has had four military coups against elected government in the last 50 years.
No top generals have been arrested for political reasons during that time.
Eruygur's lawyer, Filiz Esen, told reporters at the court: "A commander who served his country for years was arrested today with false accusations. We accept none of these accusations."
The lawyer for Hursit Tolon, Ozgur Meric Turan, said: "We will appeal this ruling as soon as possible."
All of those detained on Tuesday were known critics of the AK Party government. Some were released but others were barred from leaving the country while the case continued.
They were detained hours before the first hearing in a case in which the AK Party faces possible closure on charges of trying to introduce Islamic rule.
The party dismisses the charges as politically motivated and points to its pro-business, pro-reform record in office.
Dozens of people had already been detained for suspected links to the Ergenekon group, including retired army officers.
Opponents of the government have questioned the coup allegations, pointing to the fact that no indictment has been released despite a 13-month long investigation.
The military -- which has repeatedly criticised the government and considers itself the guardian of Turkey's secular system -- has denied any links to the Ergenekon group.
The high-profile arrests and start of the case to close the party hit Turkish stock prices and the lira currency on Tuesday. The markets later rebounded thanks to foreign cash inflows. (Editing by Stephen Weeks)