The Trump administration has sought to rein in North Korea’s nuclear program by passing tougher and tougher sanctions designed to punish its economy. A new study shows why that isn’t working.

A whopping 49 countries have violated UN Security Council sanctions imposed on North Korea between March 2014 and September 2017, according to a report from the Institute for Science and International Security, a nonpartisan Washington think tank focused on nuclear non-proliferation.

Drawing from UN data, the study found that countries ranging from poor and isolated nations like Angola to wealthier global powers like Germany have ignored a wide variety of measures banning economic activity and military ties with the hermit kingdom.

It’s already difficult for the US to pass harsh sanctions against Pyongyang at the UN because China and, to a lesser extent, Russia, have watered down or vetoed Security Council sanctions because they want to prevent North Korea from becoming too unstable or collapsing.

That’s frustrated the Trump administration, which has been pressuring China to take stronger measures against North Korea to de-escalate Washington’s nuclear standoff with Pyongyang. That hasn’t worked as much as Trump wants, and tensions between the US and North Korea have spiked in recent weeks as the leaders of both countries talk openly about war and North Korea continues to develop missiles capable of hitting the mainland US.

But this study underscores how even when China and Russia allow sanctions through, it’s very difficult to get countries to actually comply with the measures they’ve formally agreed to support.

Various countries have failed to observe different kinds UN sanctions. A number of them have participated in banned financial transactions and other business activities with North Korea, a group which includes Brazil, China, Egypt, Germany, India, Iran, Russia, Singapore, Sri Lanka, the United Arab Emirates, and others.

Some countries import goods and minerals from North Korea that they’re not supposed to, a group that includes China, Egypt, France, Germany, India, Indonesia, Iran, Ireland, Mexico, Philippines, and Vietnam, and others.

Another group — which includes Brazil, China, Egypt, Greece, and Japan — has helped North Korea with the tricky business of shipping materials in and out of its country illicitly.

And the fourth major group highlighted is countries that have military ties with North Korea — participating in arms trading or military training. These tended to be poorer countries, including Angola, Cuba, the Democratic Republic of the Congo, Eritrea, Mozambique, Tanzania, Myanmar, and Syria.

There are a lot of violators, but keep your eye on China

The report doesn’t indicate the exact dates of these violations, so it’s unclear if the number of violations have changed since the Trump administration took office in January. The Trump administration has made isolating North Korea a major diplomatic priority in the past year, and could be making countries more attentive to whether or not they’re violating UN sanctions; many countries may fear that they themselves could become the target of future unilateral US sanctions if they neglect the UN ones too obviously.

But nonetheless the sheer number of countries willing to flout the UN sanctions — and the fact that so many of them are key US military allies — is a sober reminder of how sanctions are a highly imperfect tool for applying pressure to North Korea’s economy.

While almost all UN members pay lip service to the notion that they’re following the letter of international law, far fewer are delivering on those pledges.

The report raises the question of how many countries are already violating the last two rounds of UN sanctions passed against North Korea in recent months, which combined with previous penalties, cumulatively embargo 90 percent of North Korea’s publicly reported exports.

It’s important, however, to not lose sight of the most important name on those lists: China.

China is North Korea’s lifeline to the world, providing it with the vast majority of its food and energy, and is the source of 90 percent of North Korea’s foreign trade. Beijing’s past violations of UN sanctions have certainly contributed to the surprising resilience and growth of North Korea’s economy in recent years.

China has historically pushed back against the harshest economic punishments that the US proposes on North Korea because it doesn’t share the US’s interests on the matter. Beijing certainly doesn’t like the escalating talk of war between President Trump and North Korea’s leader, Kim Jong Un, but ultimately it isn’t as worried about North Korea’s nuclear program as it is about the potential collapse of the country itself. Such a collapse would create a refugee crisis on the Korean Peninsula and likely send millions of North Koreans pouring across the Chinese–North Korean border.

China also believes the US would dramatically increase its military presence in the region to deal with the fallout from the collapse and to secure North Korea’s nuclear weapons. A US military presence on China’s border is not something China’s leaders want to see anytime soon. As a result, China helps prop up the North Korean leadership knowing that a stable North Korea serves as a strategic buffer for itself.

New data from China indicates that it has curbed its imports of North Korean coal and other minerals in recent months. Trump’s consistent pressure on Beijing to help suffocate North Korea’s economy in light of its rapidly advancing nuclear program could be working to some degree.

But with China, analysts say it’s important to wait and see: There’s always the potential that, behind the scenes, North Korea is simply finding new ways to do business with Beijing.