US Secretary of State John Kerry nudged China on Monday to agree a code of conduct to prevent clashes in the South China Sea after the Philippines accused Beijing of a "massive" military build-up.

But Kerry, speaking at Asia-Pacific foreign ministerial talks in the tiny petro-state of Brunei, said after a meeting with his Chinese counterpart that the two Pacific powers were united in their opposition to North Korea's nuclear drive.

A year after a US-backed push for a South China Sea code of conduct broke down acrimoniously, this year's hosts Brunei have instilled a more cordial tone, with China agreeing Sunday to hold talks on establishing such a code.

"We very much hope to see progress on a substantive code of conduct to help ensure stability in this vital region," Kerry said at a meeting with foreign ministers of the Association of Southeast Asian Nations (ASEAN).

Overlapping claims to the South China Sea loom as a flashpoint, with China claiming virtually all of the body of water, drawing accusations from rival claimants the Philippines and Vietnam that it is mounting a creeping takeover of disputed islets.

ASEAN members Brunei and Malaysia, as well as Taiwan, also claim parts of the sea.

Beijing asserts the South China Sea is not Washington's concern, but Kerry insisted the United States saw a "national interest" in ensuring freedom of commerce in a waterway vital to world trade.

He reiterated after talks with Chinese Foreign Minister Wang Yi that the United States does not take a stand on individual disputes but added it had a "strong interest" in security in the sea.

On Sunday, Philippine Foreign Secretary Albert Del Rosario told his ASEAN colleagues that China had begun a "massive" military build-up in the sea and its actions "pose serious challenges for the region as a whole".

China has been reluctant to reach a code of conduct with the ASEAN bloc, preferring to negotiate individually with each country.

Last year's talks in Cambodia -- a Beijing ally -- ended without a joint statement for the first time due to intra-ASEAN acrimony over the issue.

Kerry, visiting Southeast Asia for the first time since taking over his post in February, was careful to avoid direct criticism of China.

"Our actions are not intended to contain or to counterbalance any one country," he said.

North Korea defiantly carried out its third nuclear weapons test in February and threatened to attack the United States in language that was shrill even by the standards of the reclusive communist state.

Kerry praised China for taking "very firm steps" to show displeasure with North Korea, which has long relied on Beijing for cover.

He also held a joint meeting with the foreign ministers of Japan and South Korea, saying afterwards that the three countries, plus China, firmly opposed North Korea's nuclear weapons drive.

"All of us -- all four of us -- are absolutely united and absolutely firm in our insistence that the future with respect to North Korea must include denuclearisation," Kerry said.

Kerry, who as a senator advocated direct talks with impoverished North Korea, said there was a "better path open" to the isolated regime headed by Kim Jong-Un.

"We want North Korea to understand that the region will be better with the denuclearisation and the possibilities of normal relationships," he said.

South Korean Foreign Minister Yun Byung-Se said the North's development of nuclear weapons would "never be tolerated" and Pyongyang would "face further isolation and dire consequences in the event of provocations".

Kerry, who flew straight to the meetings after an exhaustive four days in the Middle East trying to revive peace talks, also faced tension in Brunei from a usually friendly source -- the European Union.

EU officials have voiced outrage at media reports, allegedly based on information from fugitive former US contractor Edward Snowden, that US intelligence bugged European missions in Washington.

Kerry promised to probe the allegations, but said that it was "not unusual" for governments to seek information in the interests of national security.

The three-day diplomatic gathering wraps up Tuesday with a regional security forum and a meeting of foreign ministers from 26 Asia-Pacific countries and the European Union.