Image caption The 14-year-old appeared in Ballymena Magistrates' Court

A 14-year-old boy has appeared in court in Northern Ireland accused of trying to buy a sub-machine gun and 100 rounds of ammunition from the dark web.

The boy appeared in Ballymena Magistrates' Court in County Antrim.

He is charged with attempting to possess a firearm and ammunition with intent to endanger life.

A police officer told the court that she believed the boy's intention was to intimidate another person using the weapon.

He was arrested at a retail park in Coleraine, County Londonderry on Thursday.

A police officer said the boy was detained when he met an "operative" at the retail park.

The court heard that the accused tried to give the operative £150 to pay for the ammunition and that he believed he could further purchase the gun.

It also heard that the defendant told the operative that "his intention was to intimidate a third party".

Image copyright Google Image caption Police said the boy was arrested at Riverside Retail Park in Coleraine on Thursday

The police officer told the court that during an interview with police, the boy provided a pre-prepared statement naming a Jamaican man who he said had asked him to collect blank ammunition and a deactivated gun.

The officer said the accused told police he was to collect the deactivated gun in a few days.

She added: "It was in fact a live gun and ammunition."

The officer said the police opposed bail and alleged the defendant's only reason for purchasing the gun was to cause serious injury.

She said: "The account provided was somewhat unbelievable.

"He provided an account that he was purchasing a gun for a male that was a Jamaican national living in Northern Ireland who he was friendly with on Facebook."

'Guesswork'

She said none of his friends on Facebook matched the name given for the 40-year-old friend.

The officer said if the child was released he could destroy evidence by deleting any conversations he may have had online.

However, the accused's lawyer said there was no evidence presented to support what his client's intent was and described the police's assertions as "guesswork".

The judge released the defendant on bail of £500 with conditions that he stays at home overnight and does not possess a mobile phone or any other internet-enabled device.

He was also warned that he could spend months in a juvenile justice centre awaiting trial if he broke any of the conditions.

The 14-year-old is due to appear in court again on 25 April.