Image copyright Julia Quenzler Image caption Erol Incedal was sentenced alongside his friend Mounir Rarmoul-Bouhadjar

A British law student, who was cleared in the UK's first secret terror trial of plotting an attack, has been jailed for 42 months for possessing a bomb-making manual.

Erol Incedal, 27, from London, was acquitted at the Old Bailey last week of planning a terror attack.

His friend, Mounir Rarmoul-Bouhadjar, who admitted having a manual identical to Incedal's, was given three years.

Most of the trial was behind closed doors and details cannot be reported.

While sentencing, the judge said the bomb-making guide included information for viable explosive devices, although it lacked detail.

Mr Justice Nicol said: "The potential for such bombs to cause death, injury and destruction are obvious.

"The fear, panic and terror which explosions also bring are often a deliberate part of the terrorist's ambition."

He said both men had been to the Syrian-Turkish border and mixed with jihadists. While at a safe house there they had learned about weaponry and explosives.

Image caption Mounir Rarmoul-Bouhadjar admitted having a bomb-making manual

Incedal had been in custody since he was stopped by police by Tower Bridge, London, in October 2013. Rarmoul-Bouhadjar had also been on remand for about 18 months.

The case involving the two men became a legal first after an attempt by the Crown Prosecution Service to hold the entire trial in secret was scuppered by a media challenge at the High Court.

It led to the defendants, previously referred to as AB and CD, being named for the first time and the decision to split the trials into three parts - public, private with 10 accredited journalists present but barred from reporting, and completely secret.

Before the sentencing process began, Mr Justice Nicol refused to lift further reporting restrictions and said he could not give further details.

Lawyers representing several media outlets, including the BBC, had asked the judge to allow some of the secret evidence to be reported.

Analysis: BBC home affairs correspondent Dominic Casciani

Erol Incedal has been sentenced for possessing bomb-making plans - but he has been cleared of a far more serious charge of plotting some kind of terrorist attack in the UK. All clear?

Here is the problem. We don't really know what's been going on in this trial.

Incedal insisted he had a legitimate reason for carrying those plans - but we were never allowed to hear it in open court.

The judge has now blocked our media requests to report the main allegations and the reasons why the jury dismissed them.

If I knew the truth, I'd go to prison if I told you what it was.

The journalists who were accredited to sit in some of the secret parts of the case can't tell you either. Their notebooks have been taken away and remain under lock and key.

Last week Turkish-born Incedal was acquitted in a retrial of plotting with a terrorist in Syria to either murder an individual of significance, such as former Prime Minister Tony Blair, or launch an attack such as that in Mumbai in 2008.

The jury deliberated for a total of 27 hours.

The prosecution said Incedal's plans were thwarted by police who bugged his car after he was stopped for speeding in September 2013 and taken into custody.

During a search of Incedal's car while he was in custody, officers found a slip of paper inside a glasses case that had the address of a property belonging to Mr Blair and his wife Cherie.

Incedal was released and the listening device recorded him talking about buying a gun and his time in war-torn Syria.

After two weeks, armed police stopped him and Rarmoul-Bouhadjar, also 27, as they were driving in central London.

Inside Incedal's phone case was a memory card and on it were instructions on how to assemble a bomb.