A staff worker stands behind the national flags of Brazil, Russia, China, South Africa and India to tidy the flags before a group photo during the BRICS Summit at the Xiamen International Conference and Exhibition Center in Xiamen, southeastern China's Fujian Province, China September 4, 2017. REUTERS/Wu Hong/Pool

XIAMEN, China (Reuters) - The nations of the BRICS grouping strongly deplore North Korea’s nuclear test but the problem over its nuclear program should only be settled through peaceful means and dialogue, they said in a draft communique seen by Reuters on Monday.

In its sixth and most powerful nuclear test on Sunday, North Korea detonated what it said was an advanced hydrogen bomb for a long-range missile, prompting a vow of “massive” military response from the United States if it or its allies were threatened.

“We express deep concern over the ongoing tension and prolonged nuclear issue on the Korean peninsula,” the draft communique said.

A formal communique, known as the “Xiamen Declaration”, is expected to be issued at a meeting attended by heads of state from the five major emerging economies in the grouping - Brazil, Russia, India, China and South Africa - in the Chinese coastal city of Xiamen.

BRICS countries will continue to firmly oppose protectionism as they are committed to an “open and inclusive” multilateral trading system, the draft communique said.

It emphasized the need to be vigilant in guarding against “inward-looking policies” that could hurt global market confidence, calling for BRICS countries to strengthen macroeconomic and structural policy coordination.

It also called upon all countries to fully implement the Paris climate agreement, while pledging to enhance BRICS cooperation on climate change and energy and to expand green financing.

The five emerging economies agreed to jointly establish a BRICS local currency bond fund, the draft communique added.