WELLINGTON, New Zealand — New Zealand announced Tuesday that it will follow the lead of its intelligence allies by suspending its extradition treaty with Hong Kong.

The move comes in response to China passing a sweeping new security law for the semi-autonomous territory.

New Zealand is the final member of the "Five Eyes" intelligence-sharing alliance to take such action after the U.S., Australia, Canada and Britain previously announced similar measures.

New Zealand relies on China as its largest trading partner and in the past has often tried to avoid direct political confrontation. China each year buys billions of dollars worth of New Zealand's agricultural goods, including its lucrative milk powder, which is used in infant formula.

But Foreign Minister Winston Peters said the new law went against commitments China had made to the international community.

"New Zealand can no longer trust that Hong Kong's criminal justice system is sufficiently independent from China," he said.

Peters said there would be other changes to the relationship. New Zealand will now treat military and technology exports to Hong Kong in the same way as it treats such exports to China, he said. New Zealand also has updated its travel advice to warn its citizens about the risks they face under the new law.

Prime Minister Jacinda Ardern said New Zealand was following its principles.

"We do have a mature relationship with China," Ardern said. "There have been occasions where we have taken different positions. This obviously will be one of them."

China says the new security law is needed to combat terrorism and separatism and prevent Hong Kong from becoming a base for undermining Chinese state power. In general, cases will be tried in Hong Kong, but the law allows for mainland jurisdiction in some circumstances.

China's embassy in Wellington, led by ambassador Wu Xi, said New Zealand should stop interfering.

"The New Zealand government's decision is a serious violation of international law and basic norms governing international relations," the embassy said in a statement. "It is a gross interference in China's internal affairs. The Chinese side has lodged its grave concern and strong opposition."

Peters said New Zealand had taken its stance independently of its Five Eyes partners and wasn't concerned about any impact on exports. "We are surely entitled as a democracy to make our views known," he said.

He said New Zealand remains deeply concerned about the legislation and would monitor the situation in Hong Kong as the new law was enforced.