U.S. President Donald Trump, well-known for his off-the-cuff remarks, hinted Tuesday at the possibility of military action against North Korea if necessary, despite emphasizing his "good relationship" with leader Kim Jong Un.

"We have the most powerful military we have ever had and we are by far the most powerful country in the world, and hopefully we do not have to use it. But if we do, we will use it. If we have to, we will do it," Trump said during a meeting in London ahead of a summit with NATO members.

The U.S. leader had been asked about North Korea's continued development of its nuclear weapons program — which he denied was taking place — and its repeated missile tests.