WASHINGTON (NYTimes) - At the start of Donald Trump's presidency, US intelligence agencies told the new administration that while North Korea had built the bomb, there was still ample time - upward of four years - to slow or stop its development of a missile capable of hitting a US city with a nuclear warhead.
The North's young leader, Kim Jong Un, faced a range of troubles, they assured the new administration, giving Trump time to explore negotiations or pursue countermeasures.
One official who participated in the early policy reviews said estimates suggested Kim would be unable to strike the continental United States until 2020, perhaps even 2022.
Kim tested eight intermediate-range missiles in 2016, but seven blew up on the pad or shattered in flight - which some officials attributed partly to a US sabotage programme accelerated by President Barack Obama.
And while the North had carried out five underground atomic tests, the intelligence community estimated that it remained years away from developing a more powerful type of weapon known as a hydrogen bomb.
Within months, those comforting assessments looked wildly out of date.
At a speed that caught US intelligence officials off guard, Kim rolled out new missile technology and in quick succession demonstrated ranges that could reach Guam, then the West Coast, then Washington.
And on the first Sunday in September, he detonated a sixth nuclear bomb. After early hesitation among analysts, a consensus has emerged that it was the North's first successful test of a hydrogen weapon, with explosive force some 15 times greater than the atomic bomb that levelled Hiroshima.
The CIA and other US intelligence services had predicted this moment would come, eventually. For decades, they accurately projected the broad trajectory of North Korea's nuclear program. Yet their inability to foresee the North's rapid strides over the past several months now ranks among the United States' most significant intelligence failures, current and former officials said in recent interviews.
That disconnect - they saw it coming, but got the timing wrong - helps explain the confusion, mixed signals and alarm that have defined how Trump's untested national security team has responded to the nuclear crisis.
In an interview, Lt. Gen. H.R. McMaster, Trump's national security adviser, acknowledged that Kim's race to the finish line "has been quicker and the timeline is a lot more compressed than most people believed."
As a result, he argued, "we have to do everything we are doing with a greater degree of urgency, and we have to accelerate our own efforts to resolve the issue short of conflict."
Senior intelligence officials said they began investing more heavily in acquiring information on North Korea's weapons programme in 2012, reaping benefits over the past two years. But they acknowledged they made two key assumptions that proved wrong.
They assumed that North Korea would need about as much time to solve the rocket science as other nations did during the Cold War, underestimating its access to both advanced computer modeling and foreign expertise.
They also misjudged Kim, 33, who took control of the dynastic regime in late 2011 and made the weapons programme more of a priority than his father or grandfather did.
Obama warned Trump during the transition a year ago that North Korea would pose the most urgent national security threat, and almost immediately the newly installed president began repeating, publicly and privately, that he inherited "a mess" in North Korea because his predecessors did not do enough.
Former officials in the Obama administration dispute that. But some concede that the intelligence community's flawed assessment of the North's progress meant there was less pressure to bolster missile defences, more vigorously enforce sanctions or consider stepped-up covert action.
It is not clear that even with more advanced warning the Obama or Trump administrations would have been able to slow Kim's progress.
The shakiness of intelligence on North Korea casts a shadow over Trump's options going forward.
Many in the Pentagon see the failure to anticipate the North's recent breakthroughs as an ominous reminder of how much could go wrong.
A successful pre-emptive strike, for example, might require precise knowledge of the locations of manufacturing facilities, nuclear plants and storage areas, and confidence that cyberstrikes and electronic strikes would cripple Kim's ability to retaliate.
Trump, however, was not disturbed by the absence of warning, McMaster said.
"He understands human nature and understands he will never have perfect intelligence about capabilities and intentions."
Missing Critical Turns
Ever since the United States began tracking North Korea's efforts to obtain a nuclear weapon, a pattern has repeated itself: US intelligence agencies excelled at forecasting the direction and overall timeline of the programme, yet repeatedly missed critical turns.
From as early as 2000, the National Intelligence Council was remarkably prescient about North Korea's overall direction, predicting in an unclassified report that it would "most likely" have a nuclear missile that could hit US cities by 2015.
Four years later, when the United States was mired in the first year of the Iraq War, the council refined its prediction, saying a "crisis over North Korea is likely to come to a head sometime over the next 15 years," that is, no later than 2019.
None of this was ignored. President George W. Bush began a programme to interdict ships delivering material for the North's weapons programme, and he accelerated secret efforts to cripple the program by sabotaging its supply chain with bad parts.
But the CIA's main focus was on counterterrorism, and satellite coverage over North Korea was often diverted to keep troops safe in the Middle East.
The United States was surprised in 2006, when it received a heads-up about the North's first underground nuclear test - from China, only about an hour before the explosion.
It was surprised again the next year when the head of the Mossad, Israel's intelligence service, arrived at the White House with photographs showing a nuclear reactor under construction in Syria that matched the North's Yongbyon reactor.
In 2010, North Korea invited Siegfried S. Hecker, former director of the Los Alamos National Laboratory, to visit and showed him a complete uranium-enrichment plant it had built inside an old building at Yongbyon. The Koreans had installed the facility, at a site under regular satellite surveillance, without being detected.
Intelligence officials said there were good reasons for this spotty record.
Foreign governments almost never succeed in recruiting North Korean scientists as sources because they are rarely allowed to go abroad. The North also appears to have figured out the patterns of some US spy satellites.
And while documents released by Edward J. Snowden showed the National Security Agency had penetrated North Korea, it is unclear whether its cybersnooping gleaned anything useful in a nation with minimal computer networking.
A Rapid Shift
By late 2013, the intelligence community had largely changed its view of Kim.
It now appears that Kim had several missile programmes underway simultaneously, and sped efforts to make parts and missile fuel indigenously, so that the United States and its allies could not cut off his supplies.
Obama, increasingly concerned, ordered multiple reviews, including one in early 2014 in which he authorised an intensification of covert cyberstrikes and electronic strikes on the North's missile programme.
The pace of missile tests accelerated, reaching a peak of more than two dozen in 2016. But at least 10 launches failed that year, including seven of an intermediate-range missile known as the Musudan.
Former senior officials in the Obama administration say it remains unclear whether the sabotage effort contributed to the failed tests.
But this much is clear: In October 2016, Kim ordered a halt to the Musudan tests, and the missile programme rapidly shifted in a different direction, focusing on a new generation of more reliable and potent engines.
For several weeks, as this article was being prepared, intelligence agencies declined on-the-record comment.
After it was posted online Saturday, Brian P. Hale, spokesman for the director of national intelligence, issued a statement saying that "any suggestion that we didn't see these tests coming is dead wrong."
"The intelligence community has always assessed that Kim Jong Un is firmly committed to developing a nuclear capability," Hale added.
"We were therefore not surprised by his accelerated pace of testing over the past few years."
Forecasts and Physics
Entering 2018, there are several disputes inside the intelligence world about the North's capabilities.
Most intelligence agencies say the North has an arsenal of about 20 or 30 nuclear weapons, for example, but the Pentagon's Defence Intelligence Agency puts the number above 50.
It is more than an academic argument. If Trump attempted to destroy the arsenal, or if the North Korean government collapsed, the challenge would be to neutralise the weapons without any launch taking place or any warhead falling into the wrong hands. The more there are, the more difficult that task becomes.
Having underestimated the North, though, Washington now faces some risk of overstating its capabilities and intentions, some experts hold.
Hecker, the former director at Los Alamos, recently argued that North Korea needs "at least two more years and several more missile and nuclear tests" to perfect a weapon that can threaten US cities.
There is still time "to start a dialogue," he said, "in an effort to reduce current tensions and head off misunderstandings that could lead to war."