President Donald Trump found some "common strategy" with Japan, South Korea and China on his trip to Asia when it comes to dealing with North Korea, former United Nations Secretary-General Ban Ki-moon told CNBC on Monday.

"While we appreciate this maximum pressure and engagement policy, this time he has been showing some sense of flexibility in addressing this issue. He has shown some possibility of addressing this issue through diplomatic means," the South Korean diplomat said in an interview with "Power Lunch."

Trump has been traveling through Asia trying to rally global pressure against North Korea's nuclear program, among other things.

Jonathan Ernst | Reuters

President Donald Trump shares a toast during a state dinner hosted by South Korea's President Moon Jae-in at the Blue House in Seoul, South Korea November 7, 2017.

During a speech delivered in South Korea last week, Trump called North Korean leader Kim Jong Un a "tyrant." Kim's government responded by calling Trump an "old lunatic."

Ban believes the only way to deal with North Korea is through diplomatic means.

"There is no military solution," he said. "Military means sometimes may be effective for a time being but it's not sustainable. You have seen such cases in Iraq and Afghanistan and in Syria."

He is also optimistic that the sanctions against North Korea are working.

Chinese President Xi Jinping "has made it clear that they will faithfully implement the Security Council resolution, and it seems that they are now doing it. That's why North Korea recently has been criticizing China by calling them names," he said. "That means the sanctions seem to be working."