Discovery raises possibility of manufacturing painkillers more cheaply using vats of microbes rather than fields of flowers

Scientists have identified the two genes in opium poppies which are used to make codeine and morphine, two of the most important painkillers in a doctor's armoury.

The discovery opens the door to alternative ways of making the drugs which do not involve giving over vast areas of farmland to growing the flowers. One hope is to transfer the genes into microbes, which could be grown in vats and provide huge quantities of the drugs at a fraction of the cost of farming and processing the plants.

Researchers said the findings could lead to the creation of strains of opium poppies that cannot make morphine, the opiate chemical turned into heroin and exported from Afghanistan and other countries for illicit use.

More than 2,500 hectares of British fields have been turned into opium poppy farms to meet NHS demands for morphine, a potent painkiller that was first isolated in 1806. The flower variety, Papaver somniferum, has been grown commercially in the UK since 2002 and differs from the common red flower, which does not contain morphine.

Pharmaceutical companies extract the drugs by processing seed pods stripped from the flowers, producing an annual national yield of codeine and morphine of 100 tonnes. Some 27m pills containing codeine are sold over the counter every year in a painkiller market worth £500m.

A team led by Peter Facchini at the University of Calgary, in Canada, identified the two genes used to make codeine and morphine from out of 23,000 in the opium poppy. The finding, reported in the journal Nature Chemical Biology, ends a 50-year quest.

"The evolution of these two genes in a single plant species has had such a huge impact on humanity over the past several thousand years," said Facchini. "Our discovery allows this unique genetic power to be harnessed."

Microbes are already used by the medical industry to mass produce synthetic insulin for diabetics and steroids for treating rheumatoid arthritis.

Last year, Tasmania's attorney-general, Lara Giddings, raised concerns over the impact of opium poppy farms on wildlife. Farmers in the country, the world's largest producer of legal opium, reported that wallabies had been hopping around in circles after eating the plants.

In 2008, the European Union's drug agency warned that Britain faced a heroin crisis following a record harvest of poppies in Afghanistan, which accounts for 90% of the world's illicit opium. By blocking one of the genes, scientists said they could create a strain of poppies that produce codeine but do not go on to convert this into morphine, the source of heroin.

This would "allow the direct recovery of codeine from the plant and prevent the formation of morphine, which would preclude the illicit synthesis of heroin," the scientists write in the journal.