Turkey's constitutional court has ended months of political uncertainty, voting by a narrow margin not to close down the country's governing party.
By Sarah Rainsford
BBC News, Ankara
The headscarf issue has been a key test for the AK Party
The chief prosecutor brought the case in March, claiming the secular Turkish republic was in danger like never before.
He called for the AK Party to be banned and dozens of its members including the prime minister to be barred from party politics. His indictment claimed they were attempting to Islamise the country.
The AK Party, or AKP, always denied the charge. Its leaders once belonged to pro-Islamic parties, but say they've changed.
Prime Minister Recep Tayyip Erdogan welcomed the court ruling saying it had saved the party - and the country - from “a major injustice”.
But it was a narrow escape.
Six judges wanted to close the party down, just one vote short of the number required by the constitution. Four members voted for economic sanctions.
Only one judge - the chairman - wanted to dismiss the case altogether.
“I hope this ruling will be studied very well and the related party will get the message intended,” Hasim Kilic stressed as he announced the verdict inside the wood-panelled constitutional court.
“Today the court did not reach the required number of votes for a party closure […] but this decision is a warning to the party. A serious warning.”
That warning was issued along with a penalty, as the court voted to slash millions of dollars in state funding.
HAVE YOUR SAY
I have never been a supporter of the AK Party but I believe banning the winning party would have damaged democracy
“Such a decision is as bad as banning a party,” believes journalist Ilnur Cevik.
“The sanctions say the party is guilty, so its opponents will always label it as fundamentalist.”
That process has already begun.
Opposition politicians point out that the judges effectively marked the AK Party anti-secular, even if they balked at the idea of closing the party down.
The AKP won 47% support at the last election, and an all-out ban would have plunged the country into political crisis, and damaged the economy as well as Turkey's EU ambitions.
The court was split on whether to ban the party
The EU - which Turkey is negotiating to join - warned that in democracies, parties are voted out of power at the ballot box, not through the courts.
The case against the governing party was largely based on a move to lift the ban on the Islamic headscarf at university. That reform was overturned last month by the same court that just ruled on the party closure case.
The judges voted 9-2 that the headscarf reform was a threat to secularism, so many people expected a ban on the AKP to follow.
“This compromise is completely political,” argues Star newspaper editor-in-chief Mehmet Altan, although he does not believe such trials should ever take place in a democracy.
“This result actually says the AKP is not a secular party. The judges have ‘shaken' the party and told it ‘you have to work within our borders.' Their hands have been tied,” he says.
Lamenting the loss of several months - and considerable energy - on this trial Prime Minister Erdogan underlined that the AKP would now seek to push Turkey along the path of modernisation, to prosperity.
“This road will carry us to full membership of the EU,” Mr Erdogan said. “There is no way back.”
But on issues that are more controversial with secularists, like reforming the judiciary or securing more freedom for the Islamic headscarf, the party's room for manoeuvre has been limited.
Erdogan said the decision had avoided "a major injustice"
“There is no doubt that this process has given lessons to everyone - and it's no secret that the case has caused intense - but constructive - debate, within the AK Party,” says AKP parliamentarian Suat Kiniklioglu, who pronounced himself relieved at the verdict.
“That debate will inform how we go about our business in the coming months. The new challenge for us and others, including the opposition, is to steer the country to compromise.”
Plenty of sceptics remain, though.
“Now, for the next few months the AKP will look very democratic and pro-EU,” argues newspaper columnist Cuneyt Ulsever, who doesn't believe the AK Party is democratic at its core.
“Then they will sit down and say, right, to avoid another accident we need to change the make-up of the constitutional court and put our own men everywhere in the bureaucracy. Then they will run the country in their own way.”
To him, that inevitably means a more prominent role for Islam in society. The warning from the constitutional court is intended to deter such things.
For now though most of the country can breathe a sigh of relief – at least that the uncertainty of recent months has ended.
“I didn't vote for the AKP, but I'm glad it wasn't closed down. That would have flung our country back 10 years,” a taxi driver in central Ankara told the BBC.
But his main hope was that the political tension here would now be lifted.
“For the past three days while the court met, people here stopped going out,” the driver said.
“It's been very bad for business.”