* PM pledges electoral "war" as graft scandal swirls
* Erdogan says targeted through son in investigation
* Turkish military says judiciary's independence key
By Orhan Coskun and Ece Toksabay
ANKARA/ISTANBUL, Dec 27 (Reuters) - A Turkish court on Friday blocked a government attempt to force police to disclose investigations to their superiors, setting back Prime Minister Tayyip Erdogan's efforts to contain the fallout from a high-level corruption scandal.
Police on Dec. 17 detained dozens of people, among them the sons of the interior minister and two other cabinet members, after a major graft probe that was kept secret from commanders who might have informed the government in advance.
The regulation that would have forced police officers to inform their superiors about investigations was announced overnight by the government, angered at having been kept in the dark about the year-long corruption probe.
The crisis is unprecedented in Erdogan's three terms of office, triggering the ministers' resignations and then a reshuffle, as well as destabilising a Turkish economy whose rapid growth has been a showpiece of Erdogan's 11-year rule.
The lira hit a record low, stocks were at their weakest in 17 months and the cost of insuring the country's debt against default jumped to an 18-month high on Friday.
The affair turned more personal this week when Turkish media published what appeared to be a preliminary summons for Bilal Erdogan, one of the premier's two sons, to testify, although its authenticity could not immediately be verified.
Denying wrongdoing, the Erdogan government purged some 70 of the police officers involved, including the head of the force in Istanbul, and on Dec. 21 issued a new rule requiring police investigators share their findings with their superiors.
The Council of State, an Ankara court that adjudicates on administrative issues, blocked implementation of the regulation, ruling that it "contradicts the principle of the separation of powers".
With his party aswirl in speculation he might call early general elections next year, Erdogan urged supporters to vote in a March local ballot as part of a "war" on what he deems a foreign-orchestrated plot cloaked as criminal proceedings.
In a speech in Zakaria province, a heartland of his Islamist-rooted AK party, Erdogan likened ballots to bullets.
"You, with your votes, will foil this evil plot," he told the cheering crowd. "Are you committed to establishing a new Turkey? Are you ready for Turkey's new independence war?"
RALLYING THE TROOPS
He was referring to local elections three months away, in which some disappointed AK faithful might abandon the party.
AK controls two-thirds of parliament and pollsters see a modest blow to the party's base but say it could spiral if the scandal gets worse. One AK official, speaking to Reuters on condition of anonymity, predicted Erdogan could bring forward the scheduled 2015 general election to arrest such a slide.
In another dent to the party's prestige, three of its lawmakers stepped down on Friday. One of them, Ertugrul Gunay, complained of a "domineering and arrogant attitude" in AK.
Among Erdogan's past feats was pruning the power of the military, once the country's dominant authority and guardian of its secularist constitution, by championing the prosecution of scores of senior officers on putsch and terrorism allegations.
In an implied rebuke to Erdogan, the military said on Friday it had respected the judiciary independence at the time.
"The legal proceedings regarding Turkish armed forces personnel were observed in accordance with the duties and responsibilities laid out in the law," the chief of staff said.
On Thursday, a Turkish prosecutor, Muammer Akkas, said he had been removed from the corruption case and accused police of obstructing it by failing to execute his arrest warrants.
Turkey's chief prosecutor responded that Akkas was dismissed for leaking information to the media and failing to give his superiors timely updates on progress.
The government's attempts to impose new regulations on the police rile Turks who see an authoritarian streak in Erdogan and flooded the streets in mass protests this year.
The court ruling echoed an advisory issued the day before by the High Council of Judges and Prosecutors, a body which handles court appointments independent of the government.
Those jurists were excoriated by Erdogan on Friday.
"The High Council of Judges and Prosecutors has committed a crime," he said at Sakarya University after receiving an honorary doctorate. "Now I ask: Who is going to try this council? If I had the authority, I'd do it right away."
The putative Bilal Erdogan summons appeared to have come from a prosecutor's office but was unsigned. Hurriyet quoted Erdogan as saying he was the target of those naming Bilal.
"If they try to hit Tayyip Erdogan through this, they will go away empty-handed. Because they know this, they're attacking the people around me," he said.