(CNN) -- Members of Turkey's ruling party have expressed relief after the country's top court narrowly rejected calls for the party and its leaders, including Turkish Prime Minister Recep Tayyip Erdogan and President Abdullah Gul, to be banned from politics.
Prime Minister Erdogan faced a five-year ban from politics if the court had ruled against AKP.
Following days of deliberation in the four-and-a-half-month case, the constitutional court's 11 judges voted by just six to five against an indictment accusing Erdogan's Justice and Development Party (AKP) of pursuing an Islamist agenda and seeking to undermine Turkey's staunchly secular constitution. The court did impose a financial penalty stripping the party of half its public funding next year.
A verdict against AKP, which had already seen its efforts to lift a ban on the wearing of headscarves in universities overturned by the court this year, had been widely expected in the weeks leading up to the judges' deliberation amid simmering tensions between government supporters and members of Turkey's secular political elite.
But lawmaker Suat Kiniklioglu, AKP's Deputy Chairman of External Affairs, said the mood had shifted in the party's favor in recent days.
"This verdict means a very important milestone has been passed," Kiniklioglu told CNN. "It has been very tense -- the uncertainty involved in all this has been very troubling. We couldn't plan for anything. There's now great relief that the uncertainty has gone."
"It's also a major sign that it was not possible to close a party which has been running the country with a huge mandate and which won the last election convincingly."
Turkey's parliamentary speaker, Koksal Toptan told CNN Turk that the ruling had "raised the democracy bar to a higher level. A serious sense of relief will be felt in Turkey." Watch what the decision means »
But opposition leader Deniz Baykal, leader of Turkey's main opposition Republican People's Party (CHP), told CNN Turk that the court's verdict failed to solve the country's political crisis. "Ten members defined the AKP as the focal point of anti-secular activities," Baykal said.
Nationalist Party leader Devlet Bahceli, quoted in a statement in the Turkish newspaper Hurriyet, also urged AKP to heed the lessons of the case.
"Premier Erdogan and AKP should see that having problems with the constitutional order and the foundation principles of the state can jeopardize the democratic regime."
The court case was the latest confrontation between Erdogan's government and Turkish secularists, who dominate many of the country's institutions including the judiciary and the military.
Although Turkey has a predominantly Muslim culture, the modern republic has been staunchly secular since it emerged from the remnants of the Ottoman Empire in 1923.
The nomination of Gul -- whose wife wears a headscarf -- to the Turkish presidency last year provoked a parliamentary boycott by opposition lawmakers and mass demonstrations by secularists, as well as prompting Turkish army chiefs to warn that they would act to protect secularism if necessary.
In response, Erdogan called snap elections with AKP returning to government with a landslide 46.6 percent share of the vote. Gul was re-nominated to the presidency and elected by parliamentary vote the following month.
Kiniklioglu said the court verdict proved that AKP was slowly winning the argument over what kind of country Turkey should be.
"Do we want a normal European-style democracy or do we want the old semi-authoritarian country? This decision actually shows that the exclusive state elite cannot get its way, even despite everything it has been trying since last year."
Political parties have frequently been banned in the past in Turkey, including AKP's forerunner, the Welfare Party, which was disbanded by court order in 1998 after leading Turkey's first pro-Islamist coalition government between 1996 and 1997. Erdogan, then mayor of Istanbul, subsequently served four months in prison.
But banning AKP would have thrown Turkey into "years of turmoil," political analyst Ibrahim Kalin told CNN. "I think a lot of people came to their senses. This is an extremely significant and historic day for Turkish democracy."
With court chairman Hasim Kilic describing the ruling as a "serious warning" to AKP however, Kalin said that concessions from both sides were needed to head off further political crises -- and warned that many Turks remained polarized by the issue of secularism.
Kiniklioglu said it was too soon to say whether the verdict would alter AKP policies over the coming months but conceded the case had sparked a "healthy and constructive" internal debate within the party and called on the opposition to accept Thursday's verdict.
"Prime Minister Erdogan is the most respected leader in this country. We continue to be pro-European Union, pro-markets, pro-globalization and pro-democracy and I have no doubt that this is going to consolidate and strengthen our drive to democratize."