Chief-of-staff General Isik Kosaner stepped down Friday after several meetings with Prime Minister Recep Tayyip Erdogan in recent days ahead of an early August meeting of the army's high command which decides on promotions for senior officers.
Media reports blamed tensions between the military and Erdogan over army demands for the promotion of dozens of officers being held on suspicion of involvement in an alleged anti-government plot.
As well as Kosaner, the commanders of the army, air force and navy also quit, NTV and CNN-Turk reported -- a first for Turkey.
In Washington, State Department spokesman Mark Toner said that the United States had confidence in Turkey and declined comment on the military resignations. "We have confidence in the strength of Turkey's institutions, both democratic and military. It's an internal matter," Toner told reporters.
"We view Turkey as a stalwart ally within NATO, and we have a strong security cooperation with them," he said.
Kosaner was appointed to his post for a three-year term last year, while the other three commanders were due to have retired next month.
Forty-two generals and dozens of officers are in jail in a probe of alleged plots to unseat the government led by the Justice and Development Party (AKP), the moderate offshoot of a banned Islamist movement.
Several of those held are retired, but senior officers in the army have been trying to get some of the serving officers promoted despite their incarceration.
The government insists the group be forced to retire.
The most senior of the jailed group is four-star General Bilgin Balanli, head of Turkey's military academies, who had been in line to become air force commander this year. He was detained in May.
The dramatic mass resignation has particular resonance in Turkey, which endured military coups followed by periods of repression in 1960, 1971 and 1980. In 1997, an army-led campaign forced the resignation of the country's first Islamist-led government headed by Erdogan's mentor Necmettin Erbakan.
The AKP, in power since 2002, has not commented on the resignations. The party won June polls for a third straight term in its best electoral performance yet.
But Turkish President Abdullah Gul, commander-in-chief under the constitution, hosted Erdogan and military police chief General Necdet Ozel on Friday evening, leading analysts to speculate that Ozel was likely to become the new chief-of-staff.
An investigation into an alleged 2003 plan dubbed "Operation Sledgehammer" to overthrow the government will see 28 servicemen will go on trial next month. The plot was allegedly drawn up shortly after the AKP came to power amid fears it would undermine Turkey's secular system. The suspects risk 15 to 20 years in jail.
The investigation, the toughest challenge yet to the once-omnipotent Turkish military, has landed about a 10th of the army's generals in jail. The case has, however, been marred by serious doubts over the authenticity of some implicating documents.
The soldiers allegedly plotted to bomb mosques and down a Turkish jet over the Aegean and blame it on Greece, hoping to discredit the government and garner public support for a coup.
But the alleged plot leader, retired general Cetin Dogan, has said that papers from a seminar on a contingency plan based on a scenario of tensions with Greece and domestic unrest had been doctored to look like a coup plan.