Article published on the 2008-06-06 Latest update 2008-06-07 11:58 TU
The court on Thursday ruled that the constitutional amendment, which was passed by parliament in February, violated Turkey's constitutional requirement to keep religion out of state institutions.
The military, which sees itself as a defender of secularism, welcomed the decision.
The right to wear headscarves, or hijab, in universities and government offices has been a key issue dividing the AKP from the nationalist parties which it defeated in last year's election.
They argued that the change to the law was part of a hidden AKP programme of creeping Islamisation.
The law was one of the public prosecutor's principal arguments when he asked the court to ban the AKP in March this year.
"The whole country will be on tenterhooks, waiting for the Constitutional Court’s decision which is expected in the next six weeks on whether the ruling party will survive and whether the prime minister can continue to be prime minister," says correspondent Jasper Mortimer in Ankara.
European Commission President José Manuel Barroso has warned that the country's application for EU membership could be frozen if the ban goes ahead.