US defence chief James Mattis delivered a sombre caution on North Korea, saying any military attempts to resolve the crisis would be "tragic on an unbelievable scale".

Mattis was speaking on Friday to reporters at the Pentagon, days after North Korea test-fired what analysts say was its longest-range rocket yet.

Despite tough talk from top US officials in recent weeks and the deployment of an aircraft carrier strike group to the region, Mattis said the best option for North Korea is finding an international solution to effectively apply pressure on Pyongyang.

"As you know, if this goes to a military solution, it is going to be tragic on an unbelievable scale, and so our effort is to work with the UN, work with China, work with Japan, work with South Korea to try to find a way out of this situation," he said.

OPINION: Is war coming to North Korea?

North Korea is accelerating efforts to develop an intercontinental ballistic missile capable of delivering a nuclear warhead to the continental United States.

Though Mattis said Pyongyang isn't listening to cautions from the international community, he credited China's efforts to apply pressure as having some limited influence.

"There appears to be some impact by the Chinese working here," he said.

Mattis said the rocket tested on Sunday had gone extremely high and North Korean scientists were likely to have learned a lot from the test. But he would not say if it was clear the missile made a controlled re-entry from outside the atmosphere.

In North Korea on Friday, thousands of residents lined the streets to give the scientists and workers behind Sunday's missile test a hero's welcome, state media reported.

Even without its missiles, North Korea has amassed artillery units along its border with South Korea and any military action from Pyongyang could be devastating.

The capital, Seoul, is only about 55km away and the North could rain shells on to the city of 10 million.

READ MORE: North Korea threatens to sink approaching US carrier

North Korea's deputy UN envoy said on Friday the United States needed to roll back its "hostile policy" towards the country before there could be talks between the pair.

"As everybody knows, the Americans have gestured [toward] dialogue," North Korea's Deputy UN Ambassador Kim In-ryong told reporters. "But what is important is not words, but actions."

"The rolling back of the hostile policy towards DPRK is the prerequisite for solving all the problems in the Korean peninsula," he said. "Therefore, the urgent issue to be settled on the Korean peninsula is to put a definite end to the US hostile policy towards DPRK, the root cause of all problems."

North Korea is also known as the Democratic People's Republic of Korea (DPRK).

US President Donald Trump warned in an interview with Reuters news agency in late April a "major, major conflict" with the North was possible, but he said he would prefer a diplomatic outcome to the dispute over its nuclear and missile programmes.

Trump later said he would be "honoured" to meet the North's leader, Kim Jong-un, under the right conditions.