Turkey's former army chief Ilker Basbug has been charged over an alleged attempt to topple the government of Prime Minister Recep Tayyip Erdogan.
Ilkay Sezer, a lawyer for Mr Basbug, said: "The 26th chief of staff of the Turkish republic has unfortunately been placed in preventive detention for setting up and leading a terrorist group and of attempting to overthrow the government."
Dozens of army officers have been jailed in recent years as part of several investigations into alleged plots targeting the government.
But it is the first time in the history of the republic that a former chief of the Turkish military has been arrested.
Mr Basbug, who retired in 2010, is the highest-ranking officer in a massive investigation into the so-called Ergenekon network, accused of plotting to topple the ruling Justice and Development Party (AKP).
The arrest came hours after Mr Basbug testified as a suspect at an Istanbul court as part of a probe into an alleged internet campaign to discredit the government.
Among the allegations is an attempt by a group of army officers to establish websites to disseminate anti-government propaganda to destabilise the country.
Turkey's military, which considers itself as the guardian of secularism, has carried out three coups in 1960, 1971 and 1980.
This latest move appears to be a fresh warning to the military whose political influence has decreased since the AKP came to power in 2002.
Mr Basbug was later sent to Istanbul's Silivri prison where other suspects of alleged Ergenekon network are jailed.