By Sarah Rainsford
BBC News, Ankara
Officials from Turkey's governing AK Party spent six-and-a-half hours in the Constitutional Court on Thursday, arguing for their party's survival.
Turkish secularists have staged huge anti-AKP rallies
In a closed session, Deputy Prime Minister Cemil Cicek and lawmaker Bekir Bozdag presented their case to the 11 judges who will decide the fate of the party.
The AK Party, or AKP, is accused of pursuing an "Islamic agenda" for secular Turkey.
The party was created when an Islamist predecessor was closed, and has steered a moderate course ever since.
But the indictment from the chief prosecutor accuses the party of dissembling and describes the AKP as the "focus of anti-secular activities".
"Our response to this indictment is very clear. We have not been the focus of anti-secular activities. In fact, we have been the focus of serving the people," AKP member of parliament Cuneyt Yuksel told the BBC, arguing that the party's only "agenda" is further democratisation and reform.
"We don't deserve this case, we have done nothing against the law. The only thing we did is to allow girls to wear the headscarf to universities," Mr Yuksel added.
Earlier this year, the AKP backed a constitutional amendment designed to lift a ban on the Islamic headscarf on campus.
The reform was later overturned by the constitutional court which judged the move a threat to secularism. Staunch secularists see the scarf as a symbol of political Islam.
'Weakening peoples' faith'
The court's ruling could be an ominous sign for the AKP. The issue is central to the prosecutor's indictment.
That also lists quotes from the prime minister and other party members that are the prosecutor says are "anti-secular".
Prime Minister Erdogan could be barred from politics
The EU, which Turkey is negotiating to join, has underlined that in a democracy political parties are brought in and out of office through the ballot box, not the courts.
Some two dozen political parties have been closed in Turkey in the past - mostly left-wing or pro-Kurdish leaning - but this is the first time a governing party has faced that fate.
The AKP was returned to power with a massive 47% support at the last election.
"This closure case is a major stumbling block for the development of democracy in Turkey. It will weaken peoples' faith in democratic institutions," Ibrahim Kalin, chief of the Foundation for Political, Economic and Social Research (Seta), argued when the case was first filed.
"Basically, you are telling millions of people that their choice was wrong. The vast majority of Turkish people don't support this case. They don't believe the AKP is anti-secular," he added.
But powerful forces in Turkey apparently do.
The closure trial is the latest in a series of moves by secularists to rein in the AKP, stretching back to last spring.
As the party's candidate was lining up to become president, the military issued a statement warning that fundamentalism was on the rise.
It has been dubbed an e-coup.
The Constitutional Court then annulled the result of the vote.
Many suggest that the secularist elite that has held power and privilege here for so long, is attempting to block the challenge from a new class of wealthy but devout Turks, many of whom see the AKP as their representative.
This week, details of a more sinister plot to topple the government emerged.
On Tuesday, shortly before the prosecutor arrived in court to give evidence against the AKP, police detained 21 suspects in connection with an alleged coup plot. They include two former generals - both prominent critics of the government.
This in a county where the powerful military is usually beyond reproach.
There is no official information, but newspapers have revealed details of a plot to stage political assassinations and foment unrest, in order to provoke the military to intervene to restore order.
'Defenders of secularism'
The timing and scope of the arrests - the latest in a year-long investigation into the alleged plot - has fuelled speculation the AKP is using the probe to punish its opponents.
Opposition politicians have called for the evidence behind the allegations to be released, to dispel suspicions.
"These people have been targeted because they are castles of secularism and Attar's principles," said Ozgen Acar, columnist for the secularist newspaper Cumhuriyet. The paper's Ankara bureau chief was among those arrested on Tuesday.
"We are the defenders of those principles, but this government wants to open the floodgates to bring fundamentalism to Turkey," Mr Acar added. For that, he argues, the AKP should be closed.
A court reporter will now collate the evidence and set out the options before the judges. Those range from withdrawing treasury funds, to closing the entire party and banning 71 members, including the prime minister, from political party life.
At least seven members have to vote for closure.
The AKP used its appearance in court to appeal for a swift decision, concerned about the impact of this trial on the Turkish economy.
No ruling is expected before August at the earliest.