Former Defense Secretary Ash Carter told CNN on Thursday that he thinks the Obama administration could have done more on the problem of North Korea’s nuclear program.

“I think the Obama administration could have done more,” Carter told CNN’s Christiane Amanpour when she asked if it had paid too much attention to Iran and not enough to North Korea.

Carter said there was a concern “six, seven years ago” that North Korea would “obtain the capability to put a nuclear warhead atop a missile that could reach the United States” – which North Korea is now months away from being able to do, according to officials and experts.

“We knew that was a possibility six, seven years ago,” he told Amanpour.

“That’s why we built the missile defenses that are in Alaska and California. Now, that was controversial at the time, so people said we should do it, it’s a waste of money, and that the threat wasn’t there,” he noted.

“But in my mind — and I was in the Department of Defense at that time — yes, we needed to stay a step ahead of what might happen, so in the sense of deterrence and defense, I think we have well prepared ourselves. But going back now, as I said, for 25 years, I don’t think we’ve ever really given a sustained try to … diplomacy,” he said.

Carter also faulted China for “consistently failing to use its leverage” during that time. He said China has more leverage than the U.S. over North Korea.

“Where you say to North Korea, don’t test another missile. If you do, here is what’s going to happen to you. If you don’t, here is what can be done for you,” he said.

He said he could foresee a situation in which the U.S. makes a deal with North Korea to end the Korean War formally in exchange for denuclearization, but he said, “We can’t do that if they have nuclear weapons and ballistic missiles capable of attacking us.”

He also suggested a strategy to North Korea that sounded like the Trump administration’s “maximum pressure” strategy that combined diplomacy backed by economic sanctions and the threat of military force.

“We have to pursue [what] I call cohesive diplomacy which mixes the military and the diplomatic,” he said.

He also said he was confident the U.S. could win a war against North Korea, as Trump administration officials have said on repeated occasions.

“We have 28,500 troops on the Korean Peninsula. We have missile defense and we have other things — steps we’ve taken to protect ourselves if the worst comes and certainly to win a war, which I am confident we would do,” Carter said.

Carter dismissed fears among Democrats and some Republicans that President Donald Trump is so unstable and so volatile that he would start a nuclear war with North Korea on a whim.

“First of all, we’re a long way from that point with respect to North Korea,” he said.

“The way it is set up, it is a deliberative process that involves the secretary of defense — the principal adviser to the president on these matters — the chairman of the joint chiefs of staff and others in the chain of command, but also the secretary of state, the national security adviser, the director of national intelligence, the director of CIA,” he added.

“That’s the way it’s set up, and there’s a discussion and there’s an exploration of all the options on something so grave,” he said.

“People have this idea that there’s a button,” he said. “There is a process, a consultative process.”

Amanpour told Carter she thought it would be a “great comfort” to people for people to hear him say that.