Turkey's President Recep Tayyip Erdogan is promising a military shake-up after last week's failed coup attempt. More than 7,000 soldiers are already in custody, including nearly 100 generals.
Turks were thrilled to see last Friday's coup effort thwarted, but some are wondering if the armed forces are in any condition to deal with the many challenges facing the country — fighting the Islamic State, battling Kurdish militants and managing chaotic borders with Iraq and Syria.
In this rough neighborhood, Turks have relied on their strong military culture. Service is compulsory for young men, and many Turks are proud of having NATO's second-largest army, behind the U.S.
That pride suffered a wrenching blow on July 15, as people watched with horror as Turkish soldiers involved in the attempted coup opened fire on their own people.
The government blames followers of U.S.-based cleric Fetullah Gulen for the coup attempt, a charge Gulen denies. Either way, Turkey's military has suffered a huge blow to its morale, its cohesion — and perhaps its effectiveness.
A Turkish foreign policy analyst, who asked not to be identified or even recorded for fear of retribution, says the army now faces not only a leadership vacuum but a severe loss in public trust. He says the images of young soldiers being beaten by pro-government crowds are now burned into the public consciousness.
Military family members come day after day to an Istanbul courthouse in hopes of getting news about their detained sons, brothers and husbands. A man who gives his first name, Saim, says he's furious that coup-plotting commanders would use his 20-year-old son as a foot soldier and then leave him to be arrested.
Saim says he's now reluctant to send his two other sons to the military. His nephew, at his side, says he's afraid to begin his own military service. How can he sign up to protect his country if he might wind up in jail like his cousin, blamed for a crime he had nothing to do with?
Erdogan has had a roller coaster relationship with Turkey's staunchly secular military. Once a target for his religious views, Erdogan years ago allied with Gulen to try and convict hundreds of generals in cases that were widely criticized as trumped-up and were later thrown out.
In recent years, Erdogan turned against Gulen and seemed to be forging better ties with the armed forces.
Now Erdogan must protect against future coups while rebuilding a military that is badly weakened, says Aaron Stein, a Turkey expert at the Atlantic Council.
"What the coup demonstrated is that there's a senior officer corps that's entirely divided — to the point where you had senior Turkish generals who carried out a war against the state," he says. "All of this points to a military that's divided, fractured and perhaps broken."
The government says such fears are overblown. Despite the headlines about thousands of arrested soldiers, presidential adviser Ibrahim Kalin says, that's only a fraction of a military estimated at a half-million or more.
"Those who have been detained, their positions are filled as we speak, right now," says Kalin. "The top commanders, they are in their positions. They are in full control of the situation. So let's underline this: We have a very strong, large army."
But replacing the veteran officers lost to this purge will take time, Stein says. Meanwhile, Washington and the West will look on anxiously as a strategically important ally struggles to recover its footing.
"The United States has a very strong interest in Turkish stability, full stop," he says. "So, you know, a failed coup plot with airstrikes in the capital challenges the fundamental assumption that while Turkey may be a problematic ally, it was nevertheless considered to be stable. Where I think the events of the recent days say that it's profoundly unstable."
Still, Turks aren't about to abandon their military. And the West doesn't have many options when it comes to allies in this troubled region.