A sentencing hearing at the Old Bailey heard how Maxwell had constructed 14 pipe bombs. Four had already been used in attacks in Northern Ireland.

The serviceman, originally from Larne in County Antrim, was arrested by counter terrorism officers in August 2016, three months after the discovery of two arms dumps in woodland near Larne. He has since been dismissed from the armed services.

The subsequent examination of the contents of the dumps, which included explosives and other components, gave investigators their most significant clues.

They were able to trace DNA samples on some of the components back to Maxwell, whose DNA was already on the police database following a conviction for an earlier assault.

He was put under surveillance by the security services and seen visiting more arms dumps in other woodland hides not far from 40 Commando's base near Taunton in Somerset, where he was stationed.

Across more than 40 dumps, police discovered 14 pipe bombs, two Claymore anti-personnel mines, one explosively formed projectile for use against armoured vehicles, other partly constructed improvised explosive devices and large quantities of cannabis.

Image:Maxwell constructed numerous bombs, gathering materials over many years

Authorities say the commando was growing and selling cannabis to help fund the purchase of other bomb making components.

Maxwell told police he had taken a member of the Continuity IRA to one of the woodland hides in County Antrim.

The court was told that the man he took to the hide was Niall Lehd, convicted in 2014 of possession of an explosive substance with intent to endanger life.

Maxwell was described as operating like a sleeper agent, never giving himself away, as he constructed his devices.

Assistant Chief Constable Stephen Martin, from the Police Service of Northern Ireland (PSNI) said: "Ciaran Maxwell went undetected by authorities for five years. He acted alone, he wanted to go undetected and was very careful, gathering his materials over many years.

"He gathered them in small amounts to avoid suspicion. He buried his materials in different locations. He did everything he could to remain undetected."

Mr Martin said that a small number of bombs constructed by the marine were likely to still be in circulation, in the hands of dissident republican groups for use in future planned attacks.

He added: "Ciaran Maxwell does have links to violent republican dissident groups in Northern Ireland.

Image:The court heard that Maxwell had constructed 14 pipe bombs

"He was undoubtedly making these bombs in the knowledge that they would be used by these republican groupings to carry out their terrorist campaign.

"Most likely they would have been used against police officers, prison officers, other criminal justice type targets in Northern Ireland, designed to damage property, injure people and potentially kill people."

The 31-year-old, a Catholic, grew up in Larne, a predominantly loyalist community.

Some of those who know him from his hometown said they were unaware of any links to republican extremists.

When he was 16, he was very badly beaten by a loyalist gang in Larne. At the time, he told his story to the republican newspaper An Phoblacht.

The UK armed forces have carried out a review of the recruitment vetting procedures in the wake of Maxwell's arrest.

Former British army commander Colonel Richard Kemp said political correctness and human rights legislation had combined to ensure vetting within the armed forces was "not as rigorous as it once was."

He also expressed concern at apparent weaknesses within the auditing procedures for munitions stores at military bases.

Colonel Kemp said: "In reality the Armed Forces, the Marines, the Army, the RAF and the Navy are all very diligent about doing whatever they can to prevent weapons, ammunition and explosives being taken away by service personnel. But clearly there were gaps in the system which allowed this to happen.

"I'm sure the relevant military authorities will now have looked into this and done what they can to close that gap … But it is of course worrying that he was able to do this in the first place."