No one can completely understand the motivations of the North Koreans, but it is entirely possible that their recent revelation of their uranium enrichment centrifuges and Pyongyang's shelling of a South Korean island Tuesday are designed to remind the world that they deserve respect in negotiations that will shape their future. Ultimately, the choice for the United States may be between diplomatic niceties and avoiding a catastrophic confrontation.

Dealing effectively with North Korea has long challenged the United States. We know that the state religion of this secretive society is "juche," which means self-reliance and avoidance of domination by others. The North's technological capabilities under conditions of severe sanctions and national poverty are surprising. Efforts to display its military capability through the shelling of Yeongpyeong and weapons tests provoke anger and a desire for retaliation. Meanwhile, our close diplomatic and military ties with South Korea make us compliant with its leaders' policies.

The North has threatened armed conflict before. Nearly eight years ago, I wrote on this page about how in June 1994 President Kim Il Sung expelled International Atomic Energy Agency (IAEA) inspectors and proclaimed that spent fuel rods could be reprocessed into plutonium. Kim threatened to destroy Seoul if increasingly severe sanctions were imposed on his nation.

Desiring to resolve the crisis through direct talks with the United States, Kim invited me to Pyongyang to discuss the outstanding issues. With approval from President Bill Clinton, I went, and reported the positive results of these one-on-one discussions to the White House. Direct negotiations ensued in Geneva between a U.S. special envoy and a North Korean delegation, resulting in an "agreed framework" that stopped North Korea's fuel-cell reprocessing and restored IAEA inspection for eight years.

With evidence that Pyongyang was acquiring enriched uranium in violation of the agreed framework, President George W. Bush - who had already declared North Korea part of an "axis of evil" and a potential target - made discussions with North Korea contingent on its complete rejection of a nuclear explosives program and terminated monthly shipments of fuel oil. Subsequently, North Korea expelled nuclear inspectors and resumed reprocessing its fuel rods. It has acquired enough plutonium for perhaps seven nuclear weapons.

Sporadic negotiations over the next few years among North Korea, the United States, South Korea, Japan, China and Russia (the six parties) produced, in September 2005, an agreement that reaffirmed the basic premises of the 1994 accord. Its text included denuclearization of the Korean Peninsula, a pledge of non-aggression by the United States and steps to evolve a permanent peace agreement to replace the U.S.-North Korean-Chinese cease-fire that has been in effect since July 1953. Unfortunately, no substantive progress has been made since 2005, and the overall situation has been clouded by North Korea's development and testing of nuclear devices and medium- and long-range missiles, and military encounters with South Korea.

North Korea insists on direct talks with the United States. Leaders in Pyongyang consider South Korea's armed forces to be controlled from Washington and maintain that South Korea was not party to the 1953 cease-fire. Since the Clinton administration, our country has negotiated through the six-party approach, largely avoiding substantive bilateral discussions, which would have excluded South Korea.

This past July I was invited to return to Pyongyang to secure the release of an American, Aijalon Gomes, with the proviso that my visit would last long enough for substantive talks with top North Korean officials. They spelled out in detail their desire to develop a denuclearized Korean Peninsula and a permanent cease-fire, based on the 1994 agreements and the terms adopted by the six powers in September 2005. With no authority to mediate any disputes, I relayed this message to the State Department and White House. Chinese leaders indicated support of this bilateral discussion.

North Korean officials have given the same message to other recent American visitors and have permitted access by nuclear experts to an advanced facility for purifying uranium. The same officials had made it clear to me that this array of centrifuges would be "on the table" for discussions with the United States, although uranium purification - a very slow process - was not covered in the 1994 agreements.

Pyongyang has sent a consistent message that during direct talks with the United States, it is ready to conclude an agreement to end its nuclear programs, put them all under IAEA inspection and conclude a permanent peace treaty to replace the "temporary" cease-fire of 1953. We should consider responding to this offer. The unfortunate alternative is for North Koreans to take whatever actions they consider necessary to defend themselves from what they claim to fear most: a military attack supported by the United States, along with efforts to change the political regime.

The writer was the 39th president of the United States.