By Nick Tattersall and Asli Kandemir
ISTANBUL (Reuters) - Prime Minister Tayyip Erdogan looks to have the upper hand in a civil war rocking Turkey's political establishment, but his bid to break the influence of a potent Islamic cleric could roll back reforms and undermine hard-won business confidence.
What erupted a month ago as a damaging inquiry into alleged government corruption has spiralled into a battle over the judiciary with potentially much further-reaching consequences for the country's international image and Erdogan's own future.
"There is considerable risk of Turkey losing the gains in credibility and investment it has won in the past decade," a senior Turkish banker said, declining to be named for fear of repercussions for publicly criticising the government.
Despite fist fights in parliament, the opposition looks unable to prevent Erdogan's plan to put the appointment of judges, held to be under the sway of U.S.-based cleric Fethullah Gulen, more under government control.
In power since 2003, Erdogan has led what Ankara, the United States and Europe long held up as a potential model for Islamic democracy and stability for Arab states.
But a crackdown in June on anti-government protests and his response to the graft inquiry, his critics say, has betrayed increasingly authoritarian tendencies.
"Everyone knows that this plan to keep the judiciary under political control is not constitutional and is not democratic," said Koray Caliskan, an associate political science professor at Istanbul's Bogazici University.
The premier says the graft inquiry is an attempted "judicial coup" by a "parallel state", a thinly veiled reference to Gulen's influence in the judiciary and police, and has purged hundreds of police officers deemed loyal to the cleric, whose followers see him as more progressive and pro-Western.
But while new police officers and judges may slow the graft inquiries, the shakeup could fuel opposition to Erdogan and lead Gulen - a former ally who helped Erdogan's AK Party rise to power - to tacitly side with his opponents in an Istanbul election in March, a key test of the government's popularity.
Details of the corruption allegations have not been made public, but are believed to relate to construction and real estate projects and Turkey's gold trade with Iran, according to Turkish newspaper reports, citing prosecutors' documents.
The government has cast them as a smear campaign but damage has already been done.
"If a perception takes hold that you can't do business in Turkey without bribing, foreign investors may avoid privatisation tenders," said Huseyin Gurer, managing partner in Turkey for Deloitte.
"Investors may also start worrying about the legal system and may start questioning whether their rights will be preserved before the law," he told Reuters. "The government should take immediate steps to correct that perception."
Erdogan has overseen strong economic growth in Turkey since coming to power in 2002, transforming its reputation after a series of unstable coalition governments in the 1990s ran into repeated balance of payments problems and economic crises.
But its external financing needs are considerable - Barclays estimates them at $217 billion this year, more than five times the central bank's net forex reserves - and maintaining access to international capital markets at reasonable costs is vital.
"Countries where the executive is at odds with or dominates the judiciary find it hard to gain access to foreign financing," the banker said.
"Turkey is shooting itself in the foot."
Erdogan shows no sign of backing down in a struggle his supporters view as an opportunity to break the influence of Gulen's Hizmet ("Service") movement, which they see as an unaccountable force guiding democracy from behind the scenes.
President Abdullah Gul, a co-founder with Erdogan of the AK Party who has largely stayed out of the furore in recent weeks, has to ratify the judiciary bill, but has rarely used his powers to veto legislation and is broadly seen as unlikely to do so this time.
Gul nonetheless met the leaders of Turkey's three biggest opposition parties on Monday in an apparent effort to broker a last-minute reconciliation. Parliament's justice commission, dominated by the AK Party, is still reviewing the draft bill and it was unclear when it would be put to a vote in the assembly.
Erdogan said on Sunday that the opposition could challenge the changes at the constitutional court, but his critics say that would take time and come too late.
As soon as the law is ratified, the justice ministry could immediately make its own appointments at the top of the judiciary, said Idris Bal, a former AK Party deputy who quit the ruling party last year.
The corruption investigation is still ongoing but tighter control over the judiciary could help the government avoid more damaging allegations in a scandal that has already brought the resignation of three ministers before local elections in March.
But it is also likely to consolidate opposition to Erdogan's perceived authoritarianism, with talk of Gulen's movement, known as the "cemaat", tacitly backing the opposition Republican People's Party (CHP) in the key Istanbul mayoral race.
"The new generation in both the cemaat and the CHP are global-looking, pro-European Union, pro-democratisation, they know that they can work together," Caliskan said.
"I don't know if this will translate into votes, but I'm sure the cemaat will never vote for the AK Party in the next local elections."
The proposed bill would roll back some of the steps taken in a 2010 referendum on constitutional reform, a package meant to bolster the independence of the judiciary and championed by the European Union, of which Turkey aspires to be a member.
EU enlargement commissioner Stefan Fule said on Twitter late on Sunday that he had asked Turkey's authorities to ensure the changes were "in line with the principles of EU legislation".
A senior executive who advises foreign firms investing in Turkey said over the last decade it had considerably improved as a place to do business and had cut down bureaucracy.
"But it hasn't achieved the same success in terms of transparency," he said. "Foreign investors who were previously mulling coming to Turkey are now in a wait-and-see mood."
(Additional reporting by Daren Butler in Istanbul; writing by Nick Tattersall; editing by Philippa Fletcher)