A secret document, published in declassified form for the first time by the Guardian today, reveals that the US Air Force came dramatically close to detonating an atom bomb over North Carolina that would have been 260 times more powerful than the device that devastated Hiroshima.

The document, obtained by the investigative journalist Eric Schlosser under the Freedom of Information Act, gives the first conclusive evidence that the US was narrowly spared a disaster of monumental proportions when two Mark 39 hydrogen bombs were accidentally dropped over Goldsboro, North Carolina on 23 January 1961. The bombs fell to earth after a B-52 bomber broke up in mid-air, and one of the devices behaved precisely as a nuclear weapon was designed to behave in warfare: its parachute opened, its trigger mechanisms engaged, and only one low-voltage switch prevented untold carnage.

Each bomb carried a payload of 4 megatons – the equivalent of 4 million tons of TNT explosive. Had the device detonated, lethal fallout could have been deposited over Washington, Baltimore, Philadelphia and as far north as New York city – putting millions of lives at risk.

Though there has been persistent speculation about how narrow the Goldsboro escape was, the US government has repeatedly publicly denied that its nuclear arsenal has ever put Americans' lives in jeopardy through safety flaws. But in the newly-published document, a senior engineer in the Sandia national laboratories responsible for the mechanical safety of nuclear weapons concludes that "one simple, dynamo-technology, low voltage switch stood between the United States and a major catastrophe".

Writing eight years after the accident, Parker F Jones found that the bombs that dropped over North Carolina, just three days after John F Kennedy made his inaugural address as president, were inadequate in their safety controls and that the final switch that prevented disaster could easily have been shorted by an electrical jolt, leading to a nuclear burst. "It would have been bad news – in spades," he wrote.

Jones dryly entitled his secret report "Goldsboro Revisited or: How I learned to Mistrust the H-Bomb" – a quip on Stanley Kubrick's 1964 satirical film about nuclear holocaust, Dr Strangelove or: How I Learned to Stop Worrying and Love the Bomb.

Slim Pickens in a scene from Dr Strangelove or: How I Learned to Stop Worrying and Love the Bomb. Photograph: The Ronald Grant Archive

The accident happened when a B-52 bomber got into trouble, having embarked from Seymour Johnson Air Force base in Goldsboro for a routine flight along the East Coast. As it went into a tailspin, the hydrogen bombs it was carrying became separated. One fell into a field near Faro, North Carolina, its parachute draped in the branches of a tree; the other plummeted into a meadow off Big Daddy's Road.

Jones found that of the four safety mechanisms in the Faro bomb, designed to prevent unintended detonation, three failed to operate properly. When the bomb hit the ground, a firing signal was sent to the nuclear core of the device, and it was only that final, highly vulnerable switch that averted calamity. "The MK 39 Mod 2 bomb did not possess adequate safety for the airborne alert role in the B-52," Jones concludes.

The document was uncovered by Schlosser as part of his research into his new book on the nuclear arms race, Command and Control. Using freedom of information, he discovered that at least 700 "significant" accidents and incidents involving 1,250 nuclear weapons were recorded between 1950 and 1968 alone.

"The US government has consistently tried to withhold information from the American people in order to prevent questions being asked about our nuclear weapons policy," he said. "We were told there was no possibility of these weapons accidentally detonating, yet here's one that very nearly did."