Some 129 countries at the United Nations signed on to a US-drafted pledge to fight the global drug problem on Monday that US President Donald Trump warned presented a public health and national security threat.

In order to attend the brief UN event with Trump, countries had to sign the one-page ‘call to action on the world drug problem.’ Trump held a similar event at the annual gathering of world leaders in New York last year, focused on UN reform.

Trump, who has long been wary of the value of the United Nations, noted on Monday that the world body's ‘potential is being met, slowly but surely, it's being met.’

Countries signing the nonbinding US statement pledged to develop national action plans to reduce demand for illicit drugs through education, expand treatment efforts, strengthen international cooperation on justice, law enforcement and health, and cut off the supply by stopping production.

‘If we take these steps together, we can save the lives of countless people in all corners of the world,’ Trump said in brief remarks.

‘Illicit drugs are linked to organized crime, illegal financial flows, corruption and terrorism. It's vital for public health and national security that we fight drug addiction and stop all forms of trafficking and smuggling that provide the financial lifeblood for vicious transnational cartels,’ he said.

Among countries that did not sign the US drugs pledge was New Zealand. Prime Minister Jacinda Ardern noted that the United States itself was particularly focused on tackling opioids.

‘We have a number of challenges that are quite specific to New Zealand and the particular drugs that are present, but also on taking a health approach. We want to do what works and so we're using a strong evidence base to do that,’ Ardern told reporters on Sunday.

Addiction to opioids - mainly prescription painkillers, heroin and fentanyl - is a growing US problem, especially in rural areas. According to the Centers for Disease Control and Prevention, opioids were involved in more than 49,000 deaths in the country last year.

In March, Trump unveiled a plan to get tough on opioids, including cutting opioid prescriptions by changing federal programs, funding for other initiatives and stiffer sentencing laws for drug dealers.

He also suggested the death penalty for dealers, a proposal that has gained little support from drug abuse and judicial experts.