A Royal Marine built explosives for an Irish republican paramilitary group at his late grandmother's home while he was on leave, a court heard.

Ciaran Maxwell, 31, stashed anti-personnel mines, mortars, ammunition and 14 pipe bombs - four of which were deployed - in purpose-built hides in Northern Ireland and England.

The Old Bailey heard there were 43 hiding places at eight different locations.

On the second day of his sentencing hearing, prosecutor Richard Whittam QC said Maxwell, of Exminster in Devon, had ordered chemicals and other parts over the internet for delivery to Northern Ireland, and he carried ammunition with him between England and Northern Ireland by ferry.

Bomb-making materials, as well as an adapted Police Service of Northern Ireland (PSNI) pass card, a PSNI uniform and a police stab-proof vest, were found by police in barrels and buckets buried in the ground.

Paul Hynes QC, defending, said the defendant lived a double life and was a "Marine by day (and) it seems Republican bombmaker on leave".

"Mr Maxwell accepts he was a bombmaker and quartermaster for bomb parts," he said.

Asked by the judge where he built the bombs, Mr Hynes said: "Principally in Northern Ireland, mostly at his grandmother's house.

"She died in 2015, but he was able to use her address before that very occasionally for a few bits and bobs.

"Essentially when he had time to himself at his grandmother's house, that's what he did."

Mr Whittam said the serviceman, who is originally from Larne in Co Antrim, had apparently been motivated by republican connections.

"He was motivated by dissident republican sympathies and a hostility to what one would say was broadly the UK, against a loyalist view," he said.

The prosecutor said emails showed he had chemicals shipped to the address of his late grandmother, who had cared for him as a child, and Maxwell had also carried ammunition with him on the ferry between England and Northern Ireland.

Mr Whittam said: "There is concern he might have found it easier to travel between England and Northern Ireland because of the ID he would have had."

Maxwell faces years behind bars when he is sentenced after pleading guilty in February to preparation of terrorist acts between January 2011 and August last year, possessing images of bank cards for fraud and possessing cannabis with intent to supply.

Maxwell appeared on Thursday via video link from Woodhill prison in Milton Keynes, where he sat at a desk with a laptop, making notes, wearing a white Nike t-shirt.

Mr Hynes said the serviceman had grown up as a member of a small Catholic community in Larne, a predominantly unionist/loyalist area, and had suffered bullying during his school years.

"He was regularly picked on as a child by older teenagers and grown men," he said.

"That victimisation was purely as a result of being Catholic."

At 16, Maxwell was "left for dead" with a fractured skull in an attack by a group of older men armed with hammers and clubs and suffered post-traumatic stress disorder he believes affected him throughout the rest of his life, Mr Hynes said.

Mr Whittam said there was no evidence to trace Maxwell's offending to the attack on him as a teenager.

Having left Northern Ireland to study archaeology at the University of Newcastle, Maxwell failed to complete his degree and returned home where he began to drink heavily and use recreational drugs.

In 2009, he decided to try and fulfil an "ambition" to join the Marines and, shortly before a deployment to Afghanistan, met old acquaintance Niall Lehd and told him about his career.

Mr Hynes said Mr Lehd was "interested" and later revealed he was part of the Continuity IRA (CIRA) and that senior members thought Maxwell was "someone who might well be someone of use".

Maxwell feared for his life and the safety of his partner and child, as well as his family in Northern Ireland, if it became widely known he was in the British military, Mr Hynes said.

He added: "He (Maxwell) was building small devices and it became apparent that Mr Lehd was keen that their acquaintanceship should continue and become deeper and Mr Maxwell should take a part in what in the beginning was a rather unusual hobby."

Mr Hynes said Maxwell had not joined the Marines in order to get access to bomb parts and had, by joining the elite infantry unit and becoming a signaller, joined "the wrong branch of the military".

He added: "He does not seek to specialise in the sort of activity that brings him before this court."

Maxwell, who was about to be promoted to corporal before he was discovered and discharged from the Marines, found the ammunition and detonator cables while on exercise and had not sought them out, Mr Hynes said.

And he deliberately kept the detonator devices in England rather than take them to Northern Ireland, where they could be used to make some of the pipe bombs "ready to go".

Maxwell was a serving Royal Marine with 40 Commando based at Norton Manor Camp in Taunton at the time of the offences and was deployed in the United States, Cyprus and the UK - but not Northern Ireland - after enlisting in 2010.

The hearing was adjourned until 10am on Friday.