A former gang associate imported up to $13,000 of ecstasy in three months through the dark web, a court has heard.

Regan Trevor Howells, 25, appeared in the Dunedin District Court yesterday after pleading guilty to three counts of importing the class-B drug.

When he was caught, he told police he was planning to make money from sales of the substance because he had recently lost his job.

The court previously heard Howells had worked in the automotive industry but left because of mental health problems.

Advertisement

Defence counsel Andrew Dawson told the court his client suffered from a panic disorder, agoraphobia, anxiety and depression.

Howells' drug offending had been linked to a gang - understood to be the Tribesmen Motorcycle Club - but he had since removed himself from that group, Dawson said.

The heavily tattooed defendant was determined to undergo ''physical changes'' that would distance him from the group.

The Dunedin Organised Crime Squad became aware of Howells' role in sourcing drugs last year.

In June or July, the defendant accessed a Germany-based site through the dark web and paid for 5g of MDMA in crystal form by Bitcoin.

He supplied his own name and the address of his St Kilda home for the delivery.

Soon after, Howells was back online making another purchase.

This time he requested at least double the previous amount and gave a family member's Andersons Bay address.

Advertisement

The package was intercepted by Customs and found to contain 21.6g of ecstasy.

Undeterred, Howells repeated the order.

Again it was seized before it got to Dunedin. It contained 53 tablets, worth more than $2000.

In total, the haul would have fetched between $8000 and $13,000 on the street, Judge John Macdonald said.

A report put Howells at low risk of reoffending and assessed him as ''insightful'' about the possible impact of his offending.

Dawson also stressed his client had donated $500 to the Salvation Army.

Howells was jailed for 27 months.