General Joe Dunford, the chairman of the US joint chiefs of staff, also told reporters during his visit to Beijing that the US has no plans to "dial back" military exercises with South Korea, which have angered both China and North Korea.
General Dunford made the remarks on the last day of a trip to China that included a visit on Wednesday to a northern military zone near China's border with North Korea.
"What's unimaginable to me is not a military option," General Dunford told reporters before a meeting with Chinese President Xi Jinping.
"What is unimaginable is allowing (North Korean leader Kim Jong-Un) to develop ballistic missiles with a nuclear warhead that can threaten the United States and continue to threaten the region."
In Seoul, South Korean President Moon Jae-In vowed Thursday that "there will be no war" on the peninsula.
General Dunford, who was in South Korea earlier this week and will land in Japan later Thursday to discuss tensions around North Korea's growing weapons programme, acknowledged that a military solution would be "horrific".
But he said it would be employed only if diplomatic and economic pressures fail to create the conditions for political dialogue.
"I do believe right now that there's a long way to go, but we are on a path where there is a possibility- and I hope a probability that we can resolve this peacefully," General Dunford said.
On Tuesday, China, which has been accused by the US of not doing enough to rein in Kim Jong Un's authoritarian regime, started implementing a ban on North Korean imports of iron, iron ore and seafood as part of a far-reaching UN Security Council resolution passed earlier this month.
China, the North's biggest ally, accounts for 90 percent of its trade.
"The reports I've heard even since I've been to Beijing have been positive in terms of Chinese commitment to enforce those sanctions," General Dunford said, though he urged China on Tuesday to increase pressure on Pyongyang.
The general went against White House aide Steve Bannon's statement in an interview published Wednesday in which he said "there's no military solution (to North Korea's nuclear threats)".
General Dunford said President Donald Trump "has told us to develop credible, viable military options, and that's exactly what we're doing".
"If the president comes to us with a decision to use military force, we will provide him with options."
The US and North Korea have been engaged in heated verbal sparring since President Trump warned Pyongyang that it faced "fire and fury" if it continued to threaten the US and other countries with its nuclear weapons and ballistic missiles.
North Korea responded that it was ready to aim a missile at the American territory Guam, but it has since suspended the operation.
Both the US and Chinese sides acknowledged during General Dunford's visit that they hold differing views on certain "sensitive issues."
In a statement, vice chairman of the Central Military Commission Fan Changlong criticised "wrongful actions" undertaken by the US that "have had a great negative impact on military and bilateral relations between the two countries".
Mr Fan cited the US deployment of the THAAD anti-missile system in South Korea, the activities of US warships in the South China Sea, and Taiwan, which receives US military aid and which Beijing considers a rebel island.
But Mr Xi Jinping during his meeting with General Dunford praised the general for a visit demonstrating that "military-to-military relations have made a substantial step forward."
On Wednesday, the two sides signed an agreement to establish regular exchanges between the offices of top US and Chinese military officials.
The first joint staff dialogue will be held in Washington this November.