WASHINGTON (Reuters) - The United States and South Korea agreed on Wednesday to step up military and diplomatic efforts to counter North Korea’s nuclear and missile programs, saying they posed a “grave” security threat following repeated tests this year.

After talks in Washington between their foreign and defense ministers, the countries said they had agreed to set up a high-level Extended Deterrence Strategy and Consultation Group to leverage “the full breadth of national power – including diplomacy, information, military coordination, and economic elements” in the face of the North Korean threat.

U.S. Secretary of State John Kerry said the United States would do “whatever is necessary” to defend itself, South Korea and other allies against North Korea.

Kerry and U.S. Defense Secretary Ash Carter reaffirmed that any attack by North Korea would be defeated, and any use of nuclear weapons “met with an effective and overwhelming response,” a joint statement said.

It said Kerry and Carter reiterated the “ironclad and unwavering” U.S. commitment “to draw on the full range of its military capabilities, including the U.S. nuclear umbrella, conventional strike, and missile defense capabilities, to provide extended deterrence” to South Korea.

Asked what the United States could do to prevent North Korea conducting more nuclear tests after those in January and September, Kerry told a news conference:

“We will up and energize those three things that we have already been doing and put greater pressure, put greater diplomacy to work, and put greater deterrence to work so that in every case we will underscore the futility of what Kim Jong-un and North Korea are pursuing.”

Slideshow ( 3 images )

He said the military option was a last resort and Washington was working to tighten sanctions, including by trying to close a loophole in U.N. steps that allowed North Korea to export coal for “livelihood” purposes.

Kerry said this was “obviously being abused ... because the greatest amount of coal, and the greatest amount of revenue, historically, has just passed between China and North Korea.”

As part of the military effort, Kerry said the United States would deploy the Terminal High Altitude Area Defense anti-missile system to South Korea “as soon as possible.”

China strongly opposes deployment of the U.S. system, saying it would impinge on its own strategic deterrence.

South Korean Foreign Minister Yun Byung-se said North Korea was nearing the “final stage of nuclear weaponization” and the allies would mobilize “all tools in the toolkit” to defend themselves.

“What is most important is to continuously demonstrate our capability and deterrence with our commitment and actions so that Pyongyang can feel the panic under their skins,” he said.

South Korea’s Yonhap news agency said “extended deterrence” could include permanent deployment of U.S. “strategic assets” in South Korea, such as nuclear-capable B-52 and B-1B bombers, F-22 stealth fighter jets and nuclear-powered submarines.

Yun said he understood this would be discussed in talks between Han and Carter at the Pentagon on Thursday, but declined to elaborate.

The Pentagon did not immediately respond when asked about the possibility of such deployments, but Carter said earlier that Washington and Seoul would “continue to modernize our alliance, seize new opportunities and address evolving threats.”