North Korean dictator Kim Jong Un appears to have blinked and President Trump can claim a foreign policy victory and justification for his strategy.

Reminiscent of President Ronald Reagan’s “peace through strength” approach to deterring adversaries, President Trump stood up to the blustering despot and forced him to back down from his threat to launch missiles at Guam.

China, North Korea’s biggest ally, no doubt played a role in getting Kim to change his mind, but primary credit should go to the president.

What a far cry from the policies of the last several administrations. They favored diplomacy over confrontation, allowing North Korea to proceed with its clandestine nuclear program in exchange for empty promises. Former President Jimmy Carter, former New Mexico Governor Bill Richardson and Secretary of State Madeleine Albright were among those who visited North Korea on various diplomatic missions. Albright engaged in a champagne toast with Kim’s father, Kim Jong-il, after claiming success in getting the country to curtail its missile program. We have seen the failure of that approach and are witnessing the success of its opposite.

Though Kim seems to have backed down from launching missiles at Guam and touting his capability to strike targets on the U.S. mainland, He has retained his overheated rhetoric. In a case of the pot calling the kettle black, Kim warned the U.S., as reported by The Wall Street Journal, “to take into full account” whether the current standoff was to its benefit. He added it was incumbent on the U.S. to “stop at once arrogant provocations against the DPRK (North Korea) and unilateral demands and not provoke it any longer.”

Who provoked whom?

Kim added, “If the Yankees persist in their extremely dangerous reckless actions on the Korean Peninsula and in its vicinity, testing the self-restraint of the DPRK, the [North] will make an important decision as it already declared,” meaning he might still order a strike against Guam, or put some missiles offshore to test American resolve.

American resolve has been tested and has prevailed, at least for now. Kim has lost face. His military leaders and others will take notice, as will the rest of the world. The significance of the unanimous UN resolution imposing new sanctions on North Korea, which included the support of China, could not have been lost on Kim.

New presidents almost always face a foreign policy test. Some pass, some fail. John F. Kennedy was judged weak by Soviet dictator Nikita Khrushchev, which many believe precipitated the Cuban missile crisis in 1962. Iran believed press reports that Ronald Reagan was a “cowboy” and dangerous, so they released American hostages on the day of his inauguration in 1981.

There is a time for diplomacy and a time for displaying strength. President Obama sent a signal to the world by setting a timetable for withdrawal of U.S. troops from Afghanistan before victory over the Taliban could be achieved. He apologized to the world for what he saw as America’s “arrogance.” Our enemies took notice and viewed his statements as an invitation to adventurism.

President Trump and his defense secretary, Gen. James “Mad Dog” Mattis, took another approach, returning Kim’s rhetorical fire with rhetorical fire of their own. It worked, at least temporarily. Where to go from here remains an open question, but the goal remains the same. North Korea (and Iran) must never be allowed to develop nuclear weapons capable of reaching the United States or threatening America’s allies, including South Korea and Japan.

President Trump deserves credit for standing up for the country and confronting one of the world’s most unpredictable dictators. He probably won’t get any credit from the media, most Democrats, or the foreign policy establishment, but our adversaries are bound to take notice and perhaps adjust their view of the president in ways that benefit America.