UNITED NATIONS — Exasperated with North Korea’s defiant testing of nuclear bombs and ballistic missiles, the United Nations Security Council voted unanimously on Wednesday to severely toughen its penalties against the isolated country.

The development also reflected closer cooperation between the United States and China on a longstanding dispute. The 15-member Council approved a resolution, negotiated for weeks by American and Chinese officials, that called for inspecting all cargo going in and out of the country, banning all weapons trade and expanding the list of individuals facing sanctions.

Diplomats said the resolution contained the most stringent measures yet to undermine the North’s ability to raise money and secure technology and other resources for its nuclear weapons program. Much depends, however, on whether China — North Korea’s leading trade partner and diplomatic shield — will enforce it. Samantha Power, the American ambassador to the United Nations, called the resolution “comprehensive, robust and unyielding,” and said enforcement must be as well.