The "core" of a major terrorism trial will be held in secret in a first for English courts, it has been ruled.

The Old Bailey ruled last week that the whole case should be heard behind closed doors but judges at the Court of Appeal amended the ruling and said not all of it should be secret.

It also named the two defendants, Erol Incedal and Mounir Rarmoul-Bouhadjar, who until now had only been referred to as AB and CD.

The two men were arrested in high-profile circumstances and are facing terrorism charges, but because of the "exceptional circumstances" it had been argued the trial should be held in secret on grounds of national security.

However, media organisations appealed against the "unprecedented" Old Bailey decision saying it was an affront to the principle that justice should be carried out in public.

On Thursday morning three court of appeal judges ruled the swearing-in of the jury, reading the charges, part of the prosecution opening, the verdict, and - if applicable - the sentencing could all be held in public.

The remainder of the trial should still be held behind closed doors, they decided.

"We are persuaded on the evidence before us that there is a significant risk - at the very least a serious possibility - that the administration of justice would be frustrated were the trial to be conducted in open court; for what appears to be good reason on the material we have seen the Crown might be deterred from continuing with the prosecution."

However, he said there were "grave concerns" about continuing to give the defendants anonymity and about holding the trial in private and that the defendants should therefore be named.

In addition, some journalists will be allowed into the trial to take notes, although not to take them away, should a decision be taken that the case can be reported at a later date.

A spokesman for the Attorney General said: "The principle of open justice is key to the British legal system and trials will always be held in public unless there are very strong reasons for doing otherwise.

"The measures applied for by the CPS in this case were, they believed, justified in order for the trial to proceed and for the defendants to hear the evidence against them while protecting national security.

"We are pleased that the Court recognised the strength of some of these arguments, and that the case can go ahead. The CPS has indicated it accepts the judgement of the Court, and will tailor its approach to the prosecution accordingly."