Intentionally or not, China’s recent report on North Korea’s nuclear weapons program has drawn welcome attention to the fact that the current nuclear negotiations with Iran have an unhappy precedent from which important lessons can be learned.

Twenty-one years ago, former President Jimmy Carter and the Clinton administration struck a deal with North Korea to exchange economic benefits for an agreement to keep the Korean Peninsula free of nuclear weapons by putting Pyongyang’s stock of plutonium under international control.

In a preview of current optimistic predictions about the political benefits of the pending Iran deal, some members of the Clinton White House reportedly believed the 1994 accord would end North Korea’s hostile isolation and open the road to peace with South Korea.

The deal lasted a little more than seven years, then was denounced by North Korea, which also admitted secretly enriching uranium, another nuclear weapons fuel. Before the agreement completely collapsed, Mr. Carter claimed in 2003 that it had succeeded in preventing North Korea from having “50 or more nuclear weapons.”

Now China estimates that North Korea has about 20 nuclear weapons and will have twice as many next year. So the 1994 deal did not stop North Korea from becoming a nuclear power in violation of its many promises not to do so.

Like the proposed deal between President Barack Obama and Iran, the North Korean pact was structured as an executive agreement with no role for Congress.

That led to partisan divisions that continue to hamper a clear response to North Korea’s cheating.

One thing is clear. President Bill Clinton left his successor, George W. Bush, to deal with a failing agreement and a complex political situation on the Korean Peninsula under the shadow of China.

Matters grew so tense during the Bush administration that Ashton Carter, President Obama’s current secretary of defense, and William Perry, who served as defense secretary under Mr. Clinton, called on President Bush to attack and destroy North Korea’s missile test facilities if necessary to stop an intercontinental ballistic missile program.

It was exactly this sort of action that Jimmy Carter said in 2003 that he believed would trigger a new Korean war with millions of victims. That possibility made the agreement he brokered imperative, he said.

Clearly, the two defense experts did not agree with this doomsday scenario.

Perhaps out of concern about China’s reaction, President Bush did not follow their advice, and today North Korea has, or is on the verge of having, missiles that can attack the United States.

Iran is not North Korea. But can it be trusted any further than Pyongyang?

Like Iran today, North Korea — in the 1990s and later — resisted giving international inspectors the right to visit any location in search of forbidden activities. That refusal to cooperate with complete verification is the most troubling aspect of what is known about Iran’s views on the pending agreement.

“When the head of Iran’s military says you will not come on our bases, that is a deal-breaker,” Sen. Lindsey Graham, R-S.C., told reporters in Washington last week while introducing an eight-point checklist for evaluating any agreement. Among its points: “Closure of all hardened and formerly secret sites. Iran must come clean on all outstanding IAEA issues, particularly possible military dimension issues. Intrusive anytime, anywhere inspections of all Iranian military and non-military facilities.”

The North Korean agreement shows what can happen when a nation wants to cheat and can maintain ambiguity about its actions and intentions by limiting verification.

Any agreement with Iran should be drawn to settle questions about verification, the removal of sanctions and any other provision that fails the clarity test.

That’s the only way to avoid repeating the perilous mistakes of the nuclear accord with North Korea.