A British man arrested in Bali for allegedly taking a package containing just over a kilogram of MDMA from a taxi driver has avoided the death penalty.

Thomas Parker, from Cumbria, was arrested near Kuta beach in January after allegedly collecting a package from a taxi driver at a nearby street.

The package contained slightly over a kilogram of MDMA, a party drug and the main ingredient in ecstasy, according to a lab test result cited in court documents.

Parker, a 32-year-old electrician by trade, was initially charged with drug trafficking and could have faced the death penalty by firing squad if found guilty.

But the trafficking charge was dropped after police investigators determined that the package was not directly linked to him.