An Istanbul court has acquitted 236 military officers of charges of plotting a coup to overthrow the government of then-Prime Minister Recep Tayyip Erdogan.

The court ruled Tuesday in favor of the officers in their retrial, launched months after the Turkey's highest court ruled that the original trial had violated the suspects' right to a fair trial.

In 2012, 326 officers were convicted of plotting to overthrow Erdogan's Islamic-based government in 2003 in an alleged plot dubbed "Sledgehammer," receiving sentences of up to 20 years imprisonment.

In June, the Constitutional Court ordered many of the officers released pending a retrial.

The initial trial helped curtail the military's hold on Turkish politics, but the case was marred by the suspects' long pre-trial confinement and judicial flaws, including allegations of fabricated evidence.