THE long battle between Turkeyâ€™s mildly Islamist ruling party and its fiercely secular establishment is coming to a climax. The outcome could decide the countryâ€™s future direction, and in particular its hopes of one day joining the European Union. On March 31st the constitutional court decided unanimously to hear a case brought by the chief prosecutor, who is seeking to ban the Justice and Development (AK) Party, and to bar 70 individuals, including the prime minister, Recep Tayyip Erdogan, from politics for at least five years. By a majority vote, the court also decided to hear a similar case against the president, Abdullah Gul.

Turkey is no stranger to bans on political parties. Its court has shut four Islamic ones since 1970, including (in 1998) the Welfare Party, of which Mr Erdogan was a member. The argument is that such parties subvert the strictly secular constitution of Ataturkâ€™s republic by promoting anti-secular activities. Yet the prosecutorâ€™s case against the AK is overtly political. His 162-page indictment is short on detailed facts, instead making much of lurid comments by local AK officials. It concedes that the partyâ€™s programme and statutes are constitutional. But it asserts in its introduction that the party â€œuses democracy to reach its goal, which is installing sharia in Turkey.â€ It goes on to cite statements made some years ago by Mr Erdogan and Mr Gul, even though both men have since insisted that they support the secular republic.

The prosecutorâ€™s biggest gripe is the AK proposal to lift the ban on women wearing the Islamic-style headscarf at universities. Indeed, the chief prosecutor explicitly warned the government in January that, if it proceeded with its plan, it might invite â€œsanctionsâ€. Yet the ban on the headscarf was strictly enforced only after a suggestion by the constitutional court when it banned Welfare in 1998. Its lifting would hardly herald an Islamic revolution.

The truth is that the prosecutor is attempting what might be called a â€œjudicial coupâ€. This follows the attempted â€œe-coupâ€ that Turkeyâ€™s overbearing generals hinted at last April, when they tried to stop the AK government from making Mr Gul (whose wife wears the headscarf) president. During the ensuing row, the constitutional court showed clearly which side it was on by overturning Mr Gulâ€™s election by parliament on a thin technicality. Mr Erdogan hit back by calling and winning an early election by a big majority, after which Mr Gul duly became president. The goal of the secular establishment now may simply be to get Mr Erdogan to quit.

That explains the broad condemnation of the courtâ€™s decision to take up the case. Most media were highly critical. The stockmarket and the currency both tumbled. Turkeyâ€™s biggest industrial lobby, Tusiad, called the case â€œunacceptable.â€ The European Unionâ€™s enlargement commissioner, Olli Rehn, said it was â€œdifficult to see that this lawsuit respects the democratic principles of a normal European society.â€

What will Mr Erdogan do? Mr Gul has promised to â€œcarry on with business as usualâ€. Mr Erdogan will not back down over the headscarf ban. He has predicted that popular support for the AK Party will rise thanks to the case, as it did after the armyâ€™s intervention last year. But he knows that a ruling against AK by the court, which is quite likely, would plunge Turkey into a deep political crisis.

His advisers want Mr Erdogan to respond by stepping up the pace of Turkeyâ€™s EU-inspired reforms. He has been slower about these in his second term than he was in his first. The lack of enthusiasm for Turkish membership in many EU countries has not helped. Nor has his war with the secularists, some of whom want to derail Turkeyâ€™s EU hopes because, as a report by the European Stability Initiative, a Berlin-based think-tank, puts it, they â€œprefer international isolation to giving up their traditional power and privileges.â€

The most likely course Mr Erdogan will pursue is to accelerate his plans to change the constitution, which was written after a military coup in 1980, to make it harder to ban parties. He needs a two-thirds majority in parliament if he is to do this unilaterally, which would mean getting the backing of either the nationalists or the main pro-Kurdish party. If he cannot secure that, he can use AKâ€™s three-fifths majority to propose constitutional changes that must then be ratified in a referendum. The EU wants the constitution to be modernised. But even if he manages it, the court may prove intractable. The next few months are going to be tricky for Turkey.