Media playback is unsupported on your device Media caption Trump says his earlier warning to North Korea "wasn't tough enough"

President Donald Trump has warned North Korea it should be "very, very nervous" if it does anything to the US.

He said the regime would be in trouble "like few nations have ever been" if they do not "get their act together".

His comments came after Pyongyang announced it had a plan to fire four missiles near the US territory of Guam.

US Defence Secretary James Mattis warned that armed conflict with North Korea would be "catastrophic" and said diplomacy was bearing fruit.

"The American effort is diplomatically led, it has diplomatic traction, it is gaining diplomatic results," he said.

Media playback is unsupported on your device Media caption Who's in Trump's good and bad books?

Australian Prime Minister Malcolm Turnbull has said his country is fully prepared to join a war against North Korea, were it to launch an attack on the US.

"If there's an attack on the US, the Anzus Treaty would be invoked and Australia would come to the aid of the United States," he said in a radio interview, "as America would come to our aid if we were attacked."

Tensions have escalated in recent weeks after North Korea tested two intercontinental ballistic missiles in July.

The UN recently approved further economic sanctions against Pyongyang over its nuclear weapons programme.

President Trump also said he was close to revealing his keenly awaited decision on the number of troops he plans to keep in Afghanistan.

He said he had "taken over a mess", but was going to make it "a lot less messy".

Speaking on Thursday at his golf club in Bedminster, New Jersey, Mr Trump suggested his own statements on North Korea had not been tough enough, despite his threat this week to rain "fire and fury" upon the regime.

North Korea has dismissed his dire warnings as "nonsense".

Media playback is unsupported on your device Media caption President Trump threatened a response 'like the world has never seen'

Mr Trump railed against previous US administrations for being too weak on North Korea and also chided the North's closest ally, China, saying it could do "a lot more".

He said: "I will tell you this, if North Korea does anything in terms of even thinking about attack of anybody that we love or we represent or our allies or us they can be very, very nervous.

"I'll tell you why… because things will happen to them like they never thought possible."

However, he added that the US would always consider negotiations.

Media playback is unsupported on your device Media caption North Korea's second intercontinental missile launched last month was "seen from Japan"

He added: "I will tell you this, North Korea better get their act together or they're gonna be in trouble like few nations have ever been."

North Korea said on Wednesday it planned to fire medium-to-long-range rockets towards Guam, where US strategic bombers are based.

However, there has been no indication that any attack on the Pacific island is imminent.

Analysis: Jitters in South Korea

Yogita Limaye, BBC News, Seoul

Media playback is unsupported on your device Media caption The BBC's Robin Brant asks those in the South Korean capital, Seoul: "Are you scared?"

On the streets of Seoul, barely 50km (30 miles) from the border with North Korea, the latest developments have drawn mixed reactions. Kim Seong-su, 62, said he thought Pyongyang was bluffing to preserve its regime and justify its nuclear programme.

But others are more concerned. Yeon Eui-sook says she finds the situation scary. "I hope everyone can live in peace. Kim Jong-un keeps doing this and making us worry," she said.

Analysts say the language from Pyongyang always gets more aggressive in August, when the US and South Korea conduct joint military exercises. But this time - with a US president who also uses strong words - the confrontation is getting even fiercer than usual.

Mr Trump meanwhile denied there were any mixed messages from his administration.

Earlier this week, US Secretary of State Rex Tillerson played down the rhetoric between the two sides.

Media playback is unsupported on your device Media caption Don't listen to Tillerson - White House

But in an interview with the BBC on Thursday, White House Deputy Assistant Sebastian Gorka dismissed the top diplomat's comments.

"You should listen to the president," he said. "The idea that Secretary Tillerson is going to discuss military matters is simply nonsensical."

Mr Gorka recalled a quote from a Holocaust survivor he often refers to when lecturing on grand strategy, saying: "When a group of people repeatedly says they want to kill you, sooner or later you should take them seriously".

"North Korea has said they wish to annihilate the United States and use nuclear weapons. Sooner or later, somebody should take them seriously," he said.

The tiny but important island of Guam

The 541sq km (209 sq miles) volcanic and coral island in the Pacific between the Philippines and Hawaii.

It is a "non-incorporated" US territory, with a population of about 163,000.

That means people born in Guam are US citizens, have an elected governor and a non-voting delegate to the House of Representatives, but cannot vote for a president in US national elections.

US military bases cover about a quarter of the island. About 6,000 personnel are based there and there are plans to move in thousands more.

It was a key US base in World War Two, and remains a vital staging post for US operations, giving access to potential flashpoints like the South China Sea, the Koreas and the Taiwan Straits.

Guam profile from BBC Monitoring

Get news from the BBC in your inbox, each weekday morning