HONG KONG — Carrots or sticks? Aid or sanctions? Engagement or containment?

American attempts to counter North Korea’s nuclear program did not begin last week when President Trump promised to unleash “fire and fury” against the isolated government. For decades, Mr. Trump’s predecessors have waded into the diplomatic mire, trying to threaten or cajole North Korea’s ruling family into abandoning the country’s weapons programs. Each failed.

North Korea, which conducted its first nuclear test in 2006, has detonated five test bombs and is expected to explode a sixth. Since 1993, the country has also launched a series of missiles, improving their distance, accuracy and lethality each year.

Despite the North’s weapons tests and its bellicose bluster, the country has occasionally signaled a willingness to talk.

Bill Clinton

The Carrot: Oil and Aid

The early 1990s brought the Korean Peninsula to the brink of war.

North Korea threatened to withdraw from the 1970 Nuclear Nonproliferation Treaty and begin to reprocess plutonium — both of which it eventually did. In 1993, the North launched a missile capable of hitting Japan. Former President Jimmy Carter went to negotiate with Kim Il-sung, the North Korean leader, against the wishes of President Bill Clinton.

The deal, which Mr. Carter struck and Mr. Clinton would eventually agree to soon after Kim’s death, amounted to a generous offer. President Clinton promised to lift decades-old sanctions, supply the North with 500,000 tons of oil a year and provide $4 billion in aid to construct a light-water reactor capable of producing nuclear energy but not weapons.

In exchange for the reactor and oil, the North would end its weapons program and close — but not dismantle — the Yongbyon complex.

North Korea’s Response

Weeks after the agreement took effect, Republicans swept Congress in the 1994 midterm elections. Congress delivered, but often delayed, promised oil shipments and refused to lift sanctions, and the light-water reactors were never built. By 1998, the North had secretly restarted its weapons program with technology purchased from the Pakistani scientist A. Q. Khan, and by 2003, the agreement was completely abandoned.

The lesson was an important one for North Korea. By provoking the West, the government had profited: It received several years of free oil and kept its nuclear power plant intact. The United States spent millions in aid and only briefly delayed the North’s weapons program.

George W. Bush

The Stick: Punishing Sanctions

President George W. Bush confronted the North for secretly building a bomb and violating the terms of the agreement.

In 2002, in his State of the Union address, Mr. Bush called North Korea, Iraq and Iran an “axis of evil.” The administration hoped to overthrow the government of Kim Jong-il by imposing punishing sanctions.

Mr. Kim responded by announcing in 2003 that his country possessed a nuclear device and would withdraw from the Nuclear Nonproliferation Treaty. That announcement ultimately brought the United States back to the negotiating table. In 2005, Mr. Kim appeared to agree to a proposal made through the six-party talks — consisting of representatives from China, Japan, North Korea, Russia, South Korea and the United States. The deal, which was briefly enforced, traded food aid for a suspension in weapons building, and the United States removed North Korea from its list of state sponsors of terrorism.

By 2006, the North Koreans had tested a bomb and were found to be exporting weapons technology to Syria.

North Korea’s Response

The North Koreans successfully gamed the United States. As the Bush administration waited for the country to collapse under the weight of sanctions, Mr. Kim successfully developed a nuclear weapon, shifting the stakes of all future courses of action.

Barack Obama

Neither Carrot Nor Stick

Just month’s into President Barack Obama’s first term, the North detonated a series of nuclear bombs.

Rather than negotiate, Mr. Obama imposed a policy of “strategic patience,” hoping that through sanctions and espionage, the United States could wait out the isolated state.

Mr. Obama hoped that the North would eventually feel it had reason to negotiate and make a good-faith effort at talks. Instead the North pursued its weapons program and launched a series of cyberattacks on American businesses, including Sony Pictures.

Mr. Obama also talked tough with the North Koreans when he thought it necessary: In 2014, he warned that the United States “will not hesitate to use our military might” to protect American allies.

North Korea’s Response

It was during the Obama administration that Kim Jong-un, a grandson of the country’s founder, was named leader after the death of his father, Kim Jong-il. The youngest Mr. Kim quickly eliminated those who might challenge his leadership and began a program, using new technology, to develop an intercontinental missile.

The Americans initially hoped the young leader would represent a break from the hard-line policies of his predecessors, but instead he doubled down. In September 2016, he tested a nuclear warhead that he claimed could fit on a long-range missile.