WASHINGTON — When John R. Bolton looks at North Korea, he sees Libya. It is not a perfect comparison, he acknowledges, but if there is a model for how to peacefully rid a hostile dictatorial state of its nuclear program, he points to the disarming of Libya some 15 years ago.

It is easy to grasp why the United States views that as a success. A ruthless despot with a history of sponsoring terrorism surrendered his efforts to build a catastrophic weapon. But that despot, Col. Muammar el-Qaddafi, might not see it as such a good deal today. No one will ever know for sure because he is dead. Which is why North Korea might not find it such an uplifting model either.

The divergent vantage points on Libya may be instructive to understand how President Trump and Mr. Bolton, his new national security adviser, are approaching the coming talks with the North Korean leader, Kim Jong-un. The divide also underscores the challenges Mr. Trump and Mr. Bolton face: As they seek to replicate the feat of eliminating Libya’s nuclear program, analysts said, they could face distrust because of the unexpected turn of events that led to Colonel Qaddafi’s demise.

Mr. Bolton, who served under President George W. Bush, views Libya through the experience of those heady days in 2003 and 2004 when Colonel Qaddafi agreed to transfer his nuclear equipment to a facility in Tennessee. Mr. Kim may remember what came later, when President Barack Obama and European allies launched military action against Libya in 2011 to prevent a threatened massacre of civilians, in the process enabling rebels not only to topple Colonel Qaddafi but also to hunt him down and kill him.