A four-megaton nuclear bomb was one switch away from exploding over the US in 1961, a newly declassified US document confirms.
Two bombs were on board a B-52 plane that went into an uncontrolled spin over North Carolina - both bombs fell and one began the detonation process.
The document was first published in the UK's Guardian newspaper.
The US government has acknowledged the accident before, but never made public how close the bomb came to detonating.
The document was obtained by journalist Eric Schlosser under the Freedom of Information Act.
Schlosser told the BBC such an explosion would have "changed literally the course of history".
The plane was on a routine flight when it began to break up over North Carolina on 23 January 1961.
As it was breaking apart, a control inside the cockpit released the two Mark 39 hydrogen bombs over Goldsboro.
One fell to the ground unarmed. But the second "assumed it was being deliberately released over an enemy target - and went through all its arming mechanisms save one, and very nearly detonated over North Carolina," Mr Schlosser told the BBC's Katty Kay.
Only one safety mechanism, a single low-voltage switch, prevented disaster, he said.
The bomb was almost 260 times more powerful than the bombs that fell on Hiroshima and Nagasaki.
The accident occurred during the height of the Cold War between US and Russia, just over a year before the Cuban missile crisis brought nuclear fears to the US's front door.
There has been ongoing speculation ever since, including a 1961 book by former government scientist Dr Ralph Lapp.
The newly declassified document was written eight years after the incident by US government scientist Parker Jones - who was responsible for mechanical safety of nuclear devices.
In it, he comments on and corrects Lapp's narrative of the accident, including listing that three out of the four fail safe mechanisms failed, not five out of six as originally thought by Lapp.
"One set off by the fall. Two rendered ineffective by aircraft breakup," Mr Jones writes. "It would have been bad news in spades."
"One simple dynamo-technology low voltage switch stood between the United States and a major catastrophe."
There has been no official comment to the newly declassified details.