MELBOURNE (Reuters) - The U.S. Pacific Fleet commander, addressing a security conference in Australia, said in answer to a question on Thursday that he would be prepared to launch a nuclear strike on China if President Donald Trump so ordered.

FILE PHOTO: Commander of the U.S. Pacific Fleet Admiral Scott Swift sits in front of a large poster of an Australian Navy frigate as he speaks during a media conference at the 2015 Pacific International Maratime Exposition in Sydney, Australia, October 6, 2015. To match Special Report USA-TRUMP/CARRIERS REUTERS/David Gray/File Photo

The fleet spokesman later said the question was asked as an “outrageous hypothetical”.

Admiral Scott Swift was speaking at the Australian National University in Canberra when he was asked whether he would be prepared to launch a nuclear attack on China if ordered to do so by Trump.

“The answer would be yes,” he said.

Swift said that all members of the U.S. military had sworn an oath to obey officers and the U.S. president as commander in chief to defend the constitution.

“This is core to the American democracy,” he said, in a recording of the event obtained by Reuters.

“Any time you have a military that is moving away from a focus, and an allegiance, to civilian control, then we really have significant problems.”

Swift’s answer reaffirmed the principle of civilian control over the military and was based on an “outrageous hypothetical” in the question, Pacific Fleet spokesman Captain Charlie Brown told Reuters.

“Frankly, the premise of the question was ridiculous,” he said. “It was posed as an outrageous hypothetical, but the admiral simply took it as an opportunity to say the fact is that we have civilian control of the military and we abide by that principle.”

Speaking in Beijing on Friday, a spokesman of China’s Foreign Ministry also downplayed the remark.

“Many people have paid attention to this but the spokesman for the Pacific Fleet has pointed out the ridiculousness of this report,” Lu Kang told a daily news briefing.

The United States and China enjoy a generally friendly relationship, with strong economic ties, albeit with frequent barbs about trade, jobs, currencies, human rights, Tibet, the South China Sea and North Korea.

Trump has held high hopes for greater cooperation from China to exert influence over North Korea, leaning heavily on Chinese President Xi Jinping for his assistance. The two leaders had a high-profile summit in Florida in April and Trump has frequently praised Xi.