Image caption Ciaran Maxwell was set upon and beaten unconscious as a teenager in Larne

A Royal Marine Commando from Northern Ireland has pleaded guilty to preparing acts of terrorism linked to dissident republicanism. Ciaran Maxwell's case raises alarming questions of how he was able to penetrate the ranks of an elite British military unit and smuggle out arms.

In the early hours of a morning back in June 2002, Maxwell, then 16, was walking from his home in Larne towards the Seacourt estate, which sits on a hill overlooking the port. What happened next left the Catholic teenager "angry and traumatised", according to someone in the nationalist community who knew him.

Maxwell was struck by a bottle, fell to the ground and was set upon and beaten unconscious by a gang of loyalists armed with golf clubs and iron bars.

The unprovoked attack featured in the republican newspaper An Phoblacht, which claimed that an Army patrol arrived at the scene but did not intervene.

That cannot be substantiated, though amid escalating tension in the town, soldiers were back on the streets to support the police who dealt with nearly 300 sectarian incidents between April 2001 and March 2004.

Image copyright Facebook Image caption Ciaran Maxwell pleaded guilty to preparing acts of terrorism

A security source we spoke to recalled shootings, houses being burnt out and regular beatings.

Mental scars

This was the environment in which Maxwell - described as a "quiet republican" - became an adult.

Several residents in his home town said the mental scars of his beating never fully healed, leaving a vulnerability that others would later exploit.

The failure of police to prosecute anyone for the assault may also have caused him bitterness.

Eight years later the adventure-loving, physically fit Maxwell began the gruelling 32-week training to become a Royal Marine, writing online: "Pain is temporary, the Green Beret is forever."

Image copyright PSNI Image caption Explosive ingredients were found buried in blue barrels

In May 2011 his mother expressed her pride ahead of attending his passing out parade in England.

But all was not as it seemed. One of the men who completed training with Maxwell, and does not want to be identified, told the BBC: "He was a strange character, very reserved, didn't join in with the banter."

He described him as "shifty" and unwilling to form close relationships with others in the unit.

Family visits

Before he had even completed his training, court papers show that Maxwell began "assisting another to commit an act of terrorism" although it is not clear which individual or group he was working with.

He was not the only young man from Larne being drawn into the orbit of dissident republicanism.

A friend from the Seacourt estate was jailed in 2014 after pleading guilty to possession of explosives with intent to endanger life. Niall Lehd had buried chemicals, a pipe bomb and a deactivated submachine gun in blue barrels in a field.

By 2016, despite having become a father, Maxwell had begun burying his own blue barrels full of explosive ingredients during visits to see family in Larne.

Image copyright PSNI Image caption Some of the ammunition discovered

In a country park, he stockpiled chemicals which he bought online, timer units and improvised detonators. Even more alarmingly, in a remote forest he hid a handgun, ammunition, pipe bombs and Claymore anti-personnel mines he had stolen from the British military.

His behaviour was becoming increasingly reckless as he built more hides in the woods near his home in Devon where he also stashed cannabis he planned to sell in Larne.

In his work locker were bank card details stolen from fellow Marines to carry out fraud and handwritten notes on tactics used by terrorist groups.

But his plans unravelled when police uncovered the hides in Northern Ireland in one of the most significant arms finds of recent years.

Murals and flags

Detectives traced the serial numbers on the mines across the Irish Sea to 40 Commando, the Royal Marine unit based near Taunton where Ciaran Maxwell had been quietly building a career. They also found his DNA on some of the material found in the woods.

Maxwell had endured so much to get the green beret only to trade it for terrorism. Was his a long-planned infiltration or was he dragged back by others to a past he thought he had escaped?

In his hometown few are willing to talk on the record about his case. Larne is much calmer these days but the occasional street mural and flag hint at the continuing presence of loyalist paramilitary groups such as the Ulster Volunteer Force and the Ulster Defence Association.

There are concerns that dissident republicans are becoming more active in parts of Northern Ireland. Last month a police officer was shot and injured in north Belfast.

Although Maxwell had links to dissident republicans, it is not known how extensive they were. A security source told the BBC that he was "operating as a bit of a lone wolf."

Sammy Wilson, Democratic Unionist MP for East Antrim, said: "There has always been a dissident group which has been operating around Larne engaged in firebombing, that kind of activity, and it's been known that they have been trying to move into the area and recruit."

Mr Wilson is concerned that Ciaran Maxwell was able to sneak munitions out of his base and evade detection for so long.

He said: "Where it is clear that someone is vulnerable either to coercion or may well have sympathies to aid and abet terrorist groups because of their background, perhaps we should give special attention to them when they come back to their own community."

The BBC asked the Ministry of Defence about its security vetting procedures for Royal Marines but received no response.

The criminal case against Ciaran Maxwell was overwhelming, paving the way for today's guilty plea.

What is much less clear is exactly why he turned to terrorism, although his actions offer a stark reminder of the dark forces that still threaten stability in Northern Ireland.