Updated

The chiefs of staff of Turkey's military resigned Friday, media reports said, as tension over the arrest of dozens of officers accused of plotting to overthrow the Islamic-rooted government reached a climax.

The resignation of so many top commanders for the first time ever in Turkey signals a deep rift with the government, which has been confident in confronting a military that once held sway over Turkish political life. The arrests of high-ranking military officers would once have been unimaginable.

The resignations of Turkey's top general, Isik Kosaner, along with the country's navy, army and air force commanders, came hours after a court charged 22 suspects, including several generals and officers, with carrying out an Internet campaign to undermine the government. The commanders asked to be retired as they quit, NTV television said.

The state-run Anatolia news agency also reported on the resignations. NTV and Anatolia didn't name their sources.

Kosaner had met with Prime Minister Recep Tayyip Erdogan and President Abdullah Gul earlier Friday to discuss several key appointments during next week's high military council meeting.

Seventeen generals and admirals, who are in line for promotion, have been jailed along with nearly 200 officers on charges of plotting to overthrow the government in 2003 in a case called the "Sledgehammer."

More than 400 people -- including academics, journalists, politicians and soldiers -- also are on trial on separate charges of plotting to bring down the government. That case is based on a conspiracy by an alleged gang of secular nationalists called "Ergenekon."

Critics say the Sledgehammer and Ergenekon cases are built on flimsy evidence and designed to silence Erdogan's pro-secular opponents. The government denies the cases are politically motivated and says it is just trying to work to improve democracy.