The top American military officer, Marine General Joseph Dunford, has warned that any war between the United States and North Korea would be "nasty."

Dunford, who is the chairman of the Joint Chiefs of Staff, made the remarks on Tuesday after he visited US Marines temporarily deployed to an Australian air force base in Darwin.

He told reporters travelling with him that the US military exhibits its warfighting capabilities in order to get a peaceful solution to the North Korean crisis.

"Right now, the military dimension of the problem is reinforcing Secretary (of State Rex) Tillerson's economic and diplomatic pressure campaign," he said. "His diplomatic efforts are underwritten by a credible military strength."

Dunford said President Donald Trump has advised him and Defense Secretary James Mattis to prepare a "full range" of military options against North Korea.

But then he added that the US is pushing for a peaceful solution to the crisis over North Korea's nuclear and ballistic missile programs.

When a marine asked that in the event of war how the Pentagon would avoid the high casualty rates that were incurred during the Korean War of 1950-53, Dunford said, “We're obviously a different force than we were even 10 years ago.”

"But at the end of the day it will be a nasty war if we fight on the Korean Peninsula and it's going to involve marines and soldiers taking ground, alongside obviously our allies and partners,” he added.

"If you are a Marine, and frankly if you are anybody in uniform, if you wake up in the morning always believing that this is the last day that you will be at peace, you are going to be in the right place," he continued.

"The last thing you want to do when you are in uniform is to be complacent and to think, nah, we are never going to go to war,” said Dunford, who was head of the Marine Corps before becoming chairman of the Joint Chiefs.

Tensions are running high between Washington and Pyongyang over North Korea's missile and nuclear programs.

The Trump administration claims it prefers a diplomatic solution to the crisis, but it also says that all options are on the table, including military ones.

Washington insists that any future talks should be aimed at North Korea giving up its nuclear weapons, something Pyongyang rejects.

North Korea has been under a raft of harsh UN sanctions since 2006 over its nuclear tests as well as multiple rocket and missile launches. Pyongyang has firmly defended its military program as a deterrent against the hostile policies of the US and its regional allies, including South Korea and Japan.

Some US officials have said North Korea has been making significant advances in its nuclear weapons using the thermonuclear test and progress in its intercontinental missile systems. They have threatened the North with a military response unless it abandons its nuclear weapons program.