ANKARA (AFP) - Turkey's constitutional court dealt another blow to Prime Minister Recep Tayyip Erdogan on Friday by annulling sections of a controversial law tightening the government's control over the judiciary.
The decision came a week after the court overturned a ban on Twitter and piled more bad news on Mr Erdogan's graft-tainted government hours after Moody's downgraded its outlook on Turkey to "negative".
The court said the most controversial clause of the law, giving the justice ministry greater control over the appointment of prosecutors and judges, was unconstitutional.
The ruling was the result of an appeal by a lawmaker from the main opposition Republican People's Party (CHP) who said it violated the principles of the separation of powers and the independence of courts.
CHP Deputy Chairman Sezgin Tanrikulu hailed the court's decision and said: "With its recent decisions, the Constitutional Court has turned into a body championing freedoms, which unsettles the regime.
"This law includes so many unconstitutional elements that it would be strange if (the court) gave another decision," Mr Tanrikulu told AFP.
But Justice Minister Bekir Bozdag said he disagreed with ruling.
"The legislation was constitutional. The court's decision has not changed my opinion in that regard. But we will of course abide by the ruling," he said.
The court also overturned parts of the law that give the justice minister the authority to investigate prosecutors of the Supreme Board of Judges and Prosecutors (HSYK), an independent body responsible for appointing members of the judiciary.
The ruling raised questions over the fate of key board members installed by the justice minister since the law was passed but Mr Bozdag insisted no decisions would be overturned.
The contentious bill, which sparked fistfights among lawmakers debating it in parliament, was signed into law by Turkish President Abdullah Gul in February despite opposition and rights groups arguing it was an attack on democracy.
It was one of the retaliatory measures taken by Prime Minister Recep Tayyip Erdogan in the wake of a graft scandal which erupted in mid-December implicating his key allies.
The premier has accused Fethullah Gulen, a US-based Muslim cleric, and his loyalists in the Turkish police and justice system, of being behind the corruption probe.
The wide-ranging investigation posed the biggest challenge to Mr Erdogan's 11-year rule and the government reacted by embarking on a mass purge of police and prosecutors believed to be close to Mr Gulen's Hizmet movement.
The now-stalled probe implicated Mr Erdogan directly in February after the publication of audio recordings allegedly showing him interfering in court cases, business deals and media coverage.
Mr Erdogan has dismissed the recordings as a "vile montage" by his rivals and accused both prosecutors and police of spying for another country.
The phone-tapping scandal, particularly the Syria leak, prompted him last to ban Twitter and YouTube - the outlets where explosive recordings have appeared - and sparked widespread condemnation from Turkey's NATO allies.
Although the Twitter ban has since been lifted, YouTube remains blocked despite two lower court orders. The video-sharing site has also filed an appeal with the top court.
Mr Erdogan said he had no "respect" for the court decision against the Twitter ban and that "insults to a country's prime minister and ministers are all around".
Mr Erdogan's AKP scored sweeping wins in the nationwide municipal polls last months but the political turmoil has also affected the economy.
The Moody's rating agency on Friday re-affirmed Turkey's current bond rating of Baa3, just one step above a so-called 'junk' level, which is out of bounds for many pension and savings funds seeking safer investments.
It also downgraded the outlook to negative due to the prospect of continued political wrangling.
"The combination of challenges facing the country today - heightened political turbulence, pressures on its external financing and the prospect of weaker growth in the medium term, shift the balance of credit risks to the downside," it said.