Turkey's embattled Prime Minister Recep Tayyip Erdogan appears willing to mend fences with the once all-powerful army which he fought hard to rein in, as he seeks to defeat an influential organisation accused of trying to topple his government.
In what is billed by observers as a dramatic turnaround, Erdogan said on Sunday he favoured fresh trials for hundreds of military officers jailed for coup-plotting in 2012 and 2013.
The court cases which landed the officers behind bars were central to his efforts to curb a military which had long dictated the running of the country, carrying out three coups since 1960.
The move comes after Erdogan's top political advisor Yalcin Akdogan last month suggested the military officers had been framed by the same prosecutors who launched a corruption probe into his government.
The government took further retaliatory action on Tuesday, sacking 350 police officers in Ankara in the latest purge against a force Erdogan once backed as a counterweight to the army.
The graft investigation -- dubbed a "dirty" plot by Erdogan -- is believed to have been masterminded by his ally-turned-foe, the self-exiled Muslim cleric Fethullah Gulen, who wields tremendous influence in the police and judiciary.
When Gulen was still his ally, the prosecutors led Erdogan's efforts to crack down on the military's power.
"The government had cooperated with the Gulen movement to break the military's dominance in politics and turned a deaf ear to pleas of injustice," said Soli Ozel, professor of international relations at Istanbul's Kadir Has University
"But the balance has changed. Erdogan now sees the Gulen group as his number one adversary and he is bringing the army over to his side to tackle it," he said.
A string of public figures including high-profile businessmen and the sons of three ministers were detained on December 17 over allegations of bribery for construction projects as well as illicit money transfers to sanctions-hit Iran.
Erdogan was forced into a major cabinet reshuffle after the resignation of the three ministers whose sons were implicated and accused Gulen of orchestrating a "judicial coup" and his followers of acting as a "state within state".
The military, which sees itself as the guardian of Turkey's secular principles, has staged three coups -- in 1960, 1971 and 1980 -- and forced out an Islamist government in 1997.
But since coming to power in 2002, Erdogan's Islamic-leaning government has sought to water down the military's influence in politics, a move seen as crucial for full membership in the European Union.
In 2012 and 2013, hundreds of military officers including former army chief General Ilker Basbug were convicted and given long jail terms for plotting to overthrow Erdogan's government in the mass "Sledgehammer" and "Ergenekon" trials.
Shortly after Erdogan's advisor Akdogan suggested so-called Gulenists had plotted against the army in court, the military demanded a review of the trials, saying evidence had been fabricated and manipulated.
The government gave the green light for a review of the court cases after a meeting between Erdogan and Metin Feyzioglu, head of the Union of Bar Associations.
"If this country's prime minister, interior minister and advisors talk of a parallel state within the judiciary, we cannot turn a deaf ear to that," Feyzioglu said.
However he added that an amnesty was "not in the pipeline".
"People who cry they are innocent are expecting, not a pardon, but a fair trial," he said.
Some analysts have said the government was forming an alliance with its former foe -- the army -- to battle the Gulen movement.
The organisation, known as Hizmet (Service) is a global foundation involved particularly in education and social issues.
However, it does not have a political party and is not expected to run in this year's elections, which kick off in March with local polls.
"The government has resorted to implicit moves in order to draw the army over to its side in its battle with the (Gulen) community," wrote journalist Ismet Berkan in the Hurriyet newspaper.
"And the military declared as its condition ... the revisiting of the Sledgehammer and Ergenekon trials".
The opposition has accused Erodgan of using the retrials as an attempt to draw eyes away from the multi-billion dollar corruption probe targeting key figures in his circle.
"They want to cover up the theft... They want to change the agenda," said Kemal Kilicdaroglu of the Republican People's Party (CHP).
Hikmet Sami Turk, a former justice minister, said he saw the latest move as an attempt to fix the injustice of the trials.
"The verdicts delivered in the Sledgehammer and Ergenekon trials were far from satisfying the public conscience," he said.
"Now a remedy is being sought. I believe the existing laws are enough to undo the injustice".