ISTANBUL—A Turkish court found more than 300 active and retired military officers guilty of plotting to overthrow the government, in a sign that the judiciary is joining a government-led effort to strip the armed forces of political influence.

The decision Friday comes after more than two years of raids, detentions and hearings, with 365 people—including some civilians—put on trial for participating in an alleged plot called Sledgehammer. Retired and active officers received as much as 20 years in prison for seeking to destabilize Turkey through clandestine agitation and prepare the grounds for a coup. Of the total, 36 were acquitted.

Relatives of Turkish officers in Silivri, left, react to a court decision in the coup trial. Agence France-Presse/Getty Images

The defendants deny the charges leveled by the state and upheld by the court.

Celal Urgen, an attorney for retired Gen. Çetin Dogan, said the defendants planned to appeal the decision, but that there was little hope for success.

"There is no free judiciary here, on the contrary, there is a judicial system that is the backyard of the government," he said in a televised speech after the verdict was announced.

Some commentators said that while the outcome was expected, the sentences seemed heavy-handed. Most people in Turkey see the verdict as a blow to the military, once the country's leading political player and self-appointed defender of the secular republic since it was established in 1923 by Mustafa Kemal Ataturk, a general who became the first president.

Military Targets

Dates in 'Sledgehammer ' case

  • Jan. 20, 2010 Taraf daily runs front-page article of an alleged military plot in 2003 to remove Prime Minister Erdogan's party from power.
  • July 19 An Istanbul court starts trial of first 196 current and former soldiers. Sets first hearing for December.
  • Dec. 29, 2011 Related cases are consolidated, bringing total number of defendants to 365.
  • April 2012 Court files complaints against defendants' attorneys who didn't attend hearings to protest the procedure.
  • Sept. 21 The court sentences 324 of the 365 defendants to prison terms ranging from 6 years to 20 years for conspiring to overthrow the government.

Source: WSJ research

Supporters of the government called the decision a victory for democracy, while others dismissed it as another tool the ruling Justice and Development Party, or AKP, is using to suppress critics. The main opposition Republican People's Party, or CHP, called the case a witch hunt.

Some analysts said the verdict calls into question relations between the civilian government and the military. They cautioned it could hurt soldiers' morale at a time when Turkey's national security is threatened by Kurdish militants seeking autonomy in the country's southeast and by the armed conflict in neighboring Syria.

"This decision seriously hurts the Turkish armed forces' morale to fight. From now on, no one will sacrifice their lives for Turkey, why should they bother?" said Atilla Yesilada, an Istanbul-based analyst with Global Source Partners, a political and economic research firm. "Political games are being played over the military, the biggest asset that Turkey has at hand just as it seeks to be a regional power in the Middle East."

A photo from February shows former Air Force Gen. Ibrahim Firtina, right, headed to court. European Pressphoto Agency

Over the past year, escalating clashes between Turkey and the Kurdistan Workers' Party, or PKK, have claimed more than 700 lives, according to the International Crisis Group, and Prime Minister Recep Tayyip Erdogan's has put his support behind rebels trying to oust Syria's President Bashar al-Assad from power.

"It's uncertain whether there can be sustainable cooperation between the government and the military to tackle national-security issues," said Robert O'Daly, a senior analyst at the Economist Intelligence Unit, London. "There is a need to move forward for the government and the armed forces."

Among the high-profile defendants found guilty are Gen. Bilgin Balanli, commander of the War College and the top-ranking active officer in the trial, and Gen. Dogan, the former commander of Turkey's First Army who was identified as the ringleader of the Sledgehammer plot.

Three generals, including Mr. Dogan, had life sentences reduced to 20 years in prison because they "only attempted" to oust Mr. Erdogan's party.

"The people who give license to these kinds of courts, who protect them, are those that applaud injustice and lawlessness," Mr. Dogan said at the conclusion of hearings Thursday.

Since the AKP came to power in 2002, it has been locked in a power struggle with the armed forces, the second largest in the North Atlantic Treaty Organization after the U.S. Friday's decision is the latest sign that Mr. Erdogan is winning against the military, which has deposed four governments since 1960.

"The impression remains that this has been at least as much a political trial as a legal one," said Bill Park, a senior lecturer who specializes in Turkish foreign and security policy at King's College, London. He said an increasing number in the military are sympathetic to the AKP, and that any effect on morale "need not be terminal."

"Of course, a worst-case scenario is that Kemalist/secularist officers are now more generally purged as part of an Islamist long march through Turkey's institutions," Mr. Park added.

The prime minister has been criticized for jailing more journalists than China and Iran, silencing the media and using the courts to go after the opposition, even while he also has been hailed for expanding civil rights as part of Turkey's effort to join the European Union.

Talking to reporters in Ankara Friday, Mr. Erdogan said the government hoped "the just decision emerges," declining further comment on the case because the process won't be completed until after appeals.

The coup-plot trials—which also include a case against an alleged clandestine organization called Ergenekon, composed of journalists, military officers and academics—have come under scrutiny for what some analysts have called flimsy evidence.

Reports from the U.S., Germany and Turkey state the evidence at the heart of the prosecutors' Sledgehammer case—a CD of key documents—is fraudulent. The findings state that Microsoft Word, Excel and PowerPoint documents dated 2002 to 2003 were prepared with fonts and in formats that the Seattle-based company didn't unveil until 2007. Some of the documents dated 2003 refer to companies established in 2008 and 2009. The findings were introduced at court by the defense.

The Sledgehammer indictment outlined an alleged plot that was to use attacks such as the bombings of Istanbul mosques to create an atmosphere of chaos and instability that would give cause for a military intervention in civilian politics.

Court documents state the coup was rehearsed during an annual army seminar in 2003, in which one of the war-game scenarios was against an "internal Islamist threat" in Turkey. Officers at the trial said the presentations at the seminar weren't coup plans, but rather hypothetical scenarios.

The traditionally secular military has always viewed the AKP government with suspicion. The AKP was formed in 2001, drawing from members of the Welfare Party, which was closed in 1998 by a court decision for violating the secularism principle of the constitution. The new party charted a more moderate course than Turkey's traditional leading Islamist party. In 1997, Welfare's coalition government had collapsed following a military decree.

In a 2010 interview with The Wall Street Journal before the trial, Mr. Doğan criticized Western countries for believing that "mild Muslims" can lead Turkey to democracy. He said, "Once [the AKP] have power all to themselves, they will turn Turkey into Iran, step by step. I see it going there."

—Ayla Albayrak and Yeliz Candemir contributed to this article.