Image caption Criminal trials: Open hearings so that justice is seen to be done

A terrorism trial could be heard entirely in secret for the first time in an English court.

Senior judges have been hearing that the Crown Prosecution Service wants the criminal case to be dealt with completely behind closed doors on grounds of national security.

The Court of Appeal is to rule in the coming days on a media challenge to the restrictions on the case.

The trial relates to two defendants referred to only as "AB" and "CD".

Criminal cases are heard in open courts which the public and media can attend. There are sometimes reporting restrictions covering specific parts of cases - but there has never been a trial that has happened completely behind closed doors.

The major terrorism case involving defendants AB and CD would be the first to involve a jury in a normal courtroom hearing evidence in secret.

The details emerged at an appeal against an order issued in May by Mr Justice Nicol which banned the identification of the defendants and access to the trial. The media were banned from reporting the existence of that order until the Court of Appeal hearing.

The court heard that AB and CD had been arrested "in high-profile circumstances" and faced allegations of the preparation of terrorist acts and possessing bomb-making instructions.

Anthony Hudson, counsel for the media organisations challenging the restrictions, told the appeal judges: "The Crown has sought and obtained an unprecedented order that the trial of two defendants charged with serious terrorism offences should take place entirely in private with the identity of both defendants withheld and a permanent prohibition on reporting what takes place during the trial and their identities.

"This appeal raises important issues relating to not only the constitutional principle of open justice but the equally important principle of fairness and natural justice."

Mr Hudson told the panel of three judges that the planned secret trial meant the court was faced with a test of its "commitment to that constitutional principle".

In 2008, the Old Bailey heard parts of a murder trial in secret on grounds of national security - but the defendant was named and large parts of the case were heard in public.

However, Mr Hudson said that the AB/CD prosecution went much further.

The court also heard that the head of the Crown Prosecution Service's counter-terrorism team had claimed that if a decision was taken to hold the trial in open court, and to identify the defendants, it might have to abandon the prosecution.

Richard Whittam QC, for the CPS, said the AB/CD trial was an exceptional circumstance.

"There is a justification for defendants to be anonymous and there is jurisdiction for the court to sit in private," he said. Mr Whittam said the complete ban on reporting the case would not necessarily exist forever.

Lord Justice Gross, Mr Justice Simon and Mr Justice Burnett said they would give their decision on the appeal in a few days' time.