Days before North Korea’s latest nuclear-bomb test, the Obama administration secretly agreed to talks to try to formally end the Korean War, dropping a longstanding condition that Pyongyang first take steps to curtail its nuclear arsenal.

Instead the U.S. called for North Korea’s atomic-weapons program to be simply part of the talks. Pyongyang declined the counter-proposal, according to U.S. officials familiar with the events. Its nuclear test on Jan. 6 ended the diplomatic gambit.

The episode, in an exchange at the United Nations, was one of several unsuccessful attempts that American officials say they made to discuss denuclearization with North Korea during President Barack Obama’s second term while also negotiating with Iran over its nuclear program.

The State Department on Sunday acknowledged the U.S. exchange with North Korea, saying it took place in accordance with longstanding U.S. goals.

“To be clear, it was the North Koreans who proposed discussing a peace treaty. We carefully considered their proposal, and made clear that denuclearization had to be part of any such discussion,” said spokesman John Kirby, adding the North rejected it. “Our response to the North Korean proposal was consistent with our longstanding focus on denuclearization.”

Mr. Obama has pointed to the Iran deal to signal to North Korea that he is open to a similar track with the regime of Kim Jong Un. But the White House sees North Korea as far more opaque and uncooperative. The latest fruitless exchanges typified diplomacy between the U.S. and Pyongyang in recent years.

Since taking power at the end of 2011, Mr. Kim has stepped up the North’s demands for a peace treaty to formally end the Korean War, 63 years after it ended with an armistice. Many analysts see the move as an attempt to force the removal of the U.S. military in the South. The U.S. insists denuclearization must have priority, and said that has to be part of any peace talks, even while dropping the precondition that North Korea first take steps that show a willingness to give up its nuclear program.

Pyongyang rejects that. “For North Korea, winning a peace treaty is the center of the U.S. relationship,” said Go Myung-hyun, an expert on North Korea at the Asan Institute for Policy Studies, a Seoul-based think tank. “It feels nuclear development gives it a bigger edge to do so.”

The international reaction to North Korea’s January nuclear test and follow-up rocket launch this month was swift, with Japan imposing new penalties on Pyongyang, South Korea closing an inter-Korean industrial park that had filled the North’s coffers and American lawmakers passing a bill to tighten economic sanctions against the regime. Mr. Obama signed the bill into law last Thursday.

Click for more from The Wall Street Journal.