A North Korean military officer, right, and another North Korean stand behind a pile of coal Dec. 14, 2012, along the banks of the Yalu River in the northeast of the North Korean border town of Siniuju. (Wang Zhao/AFP/Getty Images)

The U.N. Security Council’s move to block countries from buying North Korean coal plugs a large loophole that allowed Chinese companies to import more North Korean coal after the first U.N. ban in 2016.

Previous bans have allowed Pyongyang to sell coal for “humanitarian” trade, but Saturday’s vote banned all coal sales in an effort to choke off funding for Kim Jong Un’s weapons programs, where much of the money was funneled, according to recent U.S. court filings.

The coal trade cited in the court documents accounted for as much as one-third of North Korean exports and helps explain how North Korea continued to develop its weapons programs despite being impoverished and under trade sanctions. The connections to the military also undermine Chinese claims that their imports were benefiting North Korean civilians.

“We considered that to be a very narrow [humanitarian] exception, but it soon became clear that not all others shared our view,” a State Department spokesman said before the vote.

In the most recent court filing, unsealed last month, U.S. government attorneys were granted a seizure warrant against the largest Chinese importer of North Korean coal and four related front companies after presenting evidence that the Chinese company’s transactions with North Korea were “ultimately benefiting sanctioned North Korean end users, including North Korea military and North Korea weapons programs.”

The documents cite a defector, deemed “reliable,” who said the vast majority of the revenue from the country’s coal exports goes toward the military, nuclear missiles and weapons programs.

Those disclosures followed a court case filed in September in which federal attorneys cited a spreadsheet showing a major Chinese coal importer making purchases from various North Korean government agencies.

The Chinese importer was also purchasing from a North Korean company controlled by a secretive government branch believed to be conducting illicit activities and slush funds for political leaders.

“What these cases expose is that calling [China’s] coal business with North Korea ‘humanitarian’ is a cynical lie,” said Joshua Stanton, who runs the site One Free Korea and advises House and Senate staffers on North Korea sanctions law. “There is no such thing as truly private industry in North Korea.”

Asked last week about the coal imports, a spokesman for the Chinese Embassy said in a statement that “China has been comprehensively and accurately implementing the UN Security Council resolutions.”

Exactly how to rein in North Korea’s attempts to build a nuclear missile capable of hitting the United States has been a matter of debate for years, but recent missile launches by the reclusive country, including one last month, have intensified the discussion.

After that missile launch, President Trump tweeted that he is “very disappointed in China. Our foolish past leaders have allowed them to make hundreds of billions of dollars a year in trade, yet they do NOTHING for us with North Korea, just talk.”

What’s undisputed is the importance of coal exports to the North Korean economy. From 2010 to 2015, coal shipments accounted for about one-third of North Korea’s total export revenue, according to figures cited by the Congressional Research Service. The coal exports, which generated more than $1 billion in annual revenue, were mainly purchased by Chinese companies.

While China says its recent coal purchases comply with U.N. rules and benefit North Korean civilians, U.S. officials have reported that at least some of the coal trade is directly profiting the North Korean military.

The Treasury Department last year, for example, said that a “significant share” of the money for North Korea’s nuclear and ballistic missile program was coming from mining that often uses “workers in slave-like conditions.” Those natural resources, including coal, were sold abroad.

Some North Korean exporters, the Treasury Department said at the time, “may” be working on behalf of North Korean government or military agencies.

The more recent court filings by U.S. officials assert conclusive evidence of the connections between the North Korean exports and the military, citing business records, and give a better sense of the extent of the magnitude of the trade’s contribution to the military.

“Kim Jong Un puts over 95 percent of North Korea’s foreign currency earnings generated from coal exports toward the advancement of . . . North Korea’s military and North Korea’s nuclear missiles and weapons programs,” according to the defector, who is quoted in an affidavit filed by assistant U.S. attorneys for the District of Columbia.

The account of the defector, who is not identifed, was used to support the forfeiture of bank funds from the single largest importer of North Korean coal, a Chinese company known as Dandong Zhicheng Metallic Material.

The Chinese company imported more than $234 million of North Korean coal in 2016, according to Panjiva, a global trade data analytics company. That’s about one-fifth of North Korea’s annual coal exports.

An 80-page affidavit filed by the government — but not released to the public — describes “numerous” transactions among Dandong Zhicheng Metallic Material, its front companies and “entities known to conduct business with or on behalf of North Korea.” Portions of the government’s affidavit became public with the release of a decision by U.S. District Chief Judge Beryl A. Howell.

Another federal forfeiture case against a Chinese company, filed in September, similarly supports the claim that China’s coal imports have helped finance the North Korean government.

In that case, against Dandong Hongxiang Industrial Development, the U.S. government claims to have had access to business records reflecting coal trade between North Korea and China.

One spreadsheet at the Chinese company was labeled “anthracite data.” It summarized four months of anthracite coal shipping transactions in 2013 and names several North Korean government agencies and their front companies, according to the government’s filing. Among the entries on the “anthracite data” spreadsheet are North Korea’s National Defense Commission, the military portion of the government, and the Reconnaissance General Bureau, North Korea’s primary intelligence organization.

In addition, according to the filing, an unnamed Chinese company purchased 439,000 tons of anthracite coal from various North Korean government agencies, including some that had been under trade sanctions. Among the coal purchases made by the unnamed Chinese company was one from a front company for “Office 39 of the Korean Worker’s Party,” a secretive group that the U.S. government has said supports the North Korean leadership.

These court filings “show that the Chinese — their banks or their government or their companies — are either complicit in sanctions evasion or refusing to ask the right questions,” said Anthony Ruggiero, a former official with the Treasury and State departments, now a senior fellow at the Foundation for Defense of Democracies. “Given their relationship with North Korea and the history, the Chinese should have known that the North Korean government only allows profits to go to one of three purposes — the weapons program, the military or luxury goods for the elite.”

The U.N. Security Council specifically targeted North Korea’s coal industry for sanctions after North Korea conducted its fourth nuclear test in early 2016.

In March of that year, it required countries to cease importing North Korean coal. At the urging of the Chinese, however, it allowed coal purchases if they were for “livelihood purposes.”

“Trade related to the people’s livelihood in North Korea, especially if it embodies humanitarian principles, should not be affected by sanctions,” Foreign Ministry spokesperson Geng Shuang said last month.

The U.N. sanctions were hailed for having demonstrated “the consensus, commitment and resolution of the international community to curtail North Korean nuclear program,” said Yun Sun, a senior associate with the East Asia Program at the Stimson Center, a nonpartisan research group.

But the measure didn’t harm exports at all, at least at first, because the “humanitarian” exception turned out to be very broad.

In the nine months after the U.N. measure — from April to December 2016 — China imported 17 million metric tons of coal from North Korea. That’s more than the imports in the corresponding months for each of the previous two years, according to the Congressional Research Service.

For that reason, the United States pushed for stricter limits, and in November, the United Nations added a cap on imports of North Korean coal, with the quota set at less than half the volume of coal trade from previous year.

In mid-February, China announced that it was approaching its annual quota of North Korean coal and suspended the imports.

The volume of China’s imports of North Korean coal was still well below the quota level, however, according to U.N. statistics. The new resolution, however, blocks the resumption of any coal imports.