The former UK ambassador to Afghanistan, Sir William Patey, has come out in favour of legalising drugs after acknowledging the failure of British-led efforts over the last 10 years to eradicate poppy crops in the country.

Patey, one of the most experienced diplomats of his generation, with a string of postings that include Iraq, Sudan and Saudi Arabia, becomes one of the highest-profile figures in Britain to back legalising and regulating drugs.

His comments run counter to Home Office policy and will be rejected outright by many drug policy groups.

In an article in the Guardian, Patey, who has a reputation inside the Foreign Office for being outspoken and independent-minded, writes: "If we cannot deal effectively with supply, then the only alternative would seem to me to try to limit the demand for illicit drugs by making a licit supply of them available from a legally regulated market."

He adds: "Putting governments in control of the global drug trade through legal regulation will remove the incentive for those in fragile, insecure regions to produce and traffic drugs. Putting doctors and pharmacists in control of supply in the UK will save lives, improve health and reduce crime."

While the legalisation of cannabis is growing fast in the US and elsewhere, there is little support worldwide for similar action on opium.

Patey's call for legalising production and supply is backed by one of the leading groups calling for reform, Transform Drug Policy Foundation.

Danny Kushlick, head of external affairs at Transform, said: "The importance of Sir William's support for reform cannot be underestimated … In the absence of genuine engagement on the issue of drug policy failure from the two major political parties in the UK, it falls to the likes of Sir William to fill the gap."

But Kevin Sabet, director of the Drug Policy Institute at the University of Florida and one of the leading opponents of legalisation, said: "Legal regulation has been a disaster for drugs like alcohol and tobacco. Both of those drugs now are sold by highly commercialised industries who thrive off addiction for profit."

Sabet, who was a White House drug policy adviser in the Obama administration, added: "What we need is much smarter law-enforcement, coupled with real demand reduction in places like Europe and US. We also need true shared responsibility, which means that countries like Afghanistan must restructure their institutions and incentivise progress, rather than corruption and violence."

Patey's transformation is similar to that of another former British diplomat, Sir Keith Morris, who saw the drug wars at first-hand in the 1990s while ambassador to Colombia. In 2001, he had an article published in the Guardian describing the drug war as unwinnable and calling for legalisation.

Calls for legalisation have also been made by senior police officers and a scattering of politicians.

Afghanistan, based on UN figures, is estimated to have produced almost £1.7bn worth of opium and its derivatives heroin and morphine in 2013. Patey, in an interview with the Guardian, said he had not held strong opinions on drug policy before taking up his post in Afghanistan in 2010 and if he had thought much about it, his views would probably have been orthodox.

It was only as he was leaving Afghanistan in 2012, reflecting on successes and failures, that he acknowledged that the 10-year-old effort to stem the flow of heroin had failed. "We devoted all the resources we could. When we leave this year, poppy production will be the same – or higher – than when we seriously started trying a decade ago," he said.

Transform picked up on remarks Patey made at the time of his departure and got in contact. "They persuaded me without too much trouble that there was a better way," he said.

"Prohibition has failed and we still have a massive drug problem in this country. Drugs are still flowing from Afghanistan, we are criminalising a generation and young people are filling our prisons. By legalisation and regulation, you take control of the drug trade out of the hands of criminals and gangs and put it in the hands of doctors and nurses."