According to the properties, pure Ammonium Nitrate will decompose at 210c but the reaction stops the moment the heat source is removed.
If a catalyst in the form of finely divided is present though - the reaction is self-sustaining, and a explosive reaction is the usual result.
Leave poor-integrity sacks of this substance lying around in a warehouse for months on end, surely would have it literally “gathering dust”…?
Since DUST can be the explosive catalyst, then persons need to be brought to justice for storing this substance LONG TERM near a major populated area.
Ammonium nitrate has a molecular weight of 80. This is N (14) 4xH (4) N (14) and 3xO (48)
This means that 80 grams of NH4NO3 create one mole of each of the reaction products, which are ALL GASES.
The usual reaction that takes place above 300c is 2NH4NO3 → 2N2 + 4H2O + O2.
However, a lower-temperature decomposition reaction (possible in the prescence of a catalyst)
can cause 2NH4NO3
2NO2 + N2 +O2 + 2H2O which is brown nitrogen dioxide gas and steam, evident in the rather large mushroom cloud seen during the Beirut explosion.
NO2 is an Oxidant, highly toxic, and highly acidic to boot. The gas would have supplied yet more Oxygen to any unreacted flammable aspects in the cloud, releasing even more energy.
The initial “crackling fire” may have been the Ammonium Nitrate burning in the safer, higher temperature way, with the excess energy escaping into the air.
However, a backdraft event passing the reaction products to the unreacted sacks of excess ammonium nitrate stored seperately, likely covered in dust, and compacted together by their own weight - would have produced a detonation, leaving all kinds of mixed up reactant products, with the characteristic HUGE release of energy that goes with it.
Combine this with the fact that N2 4H2O (as superheated steam) plus O2 occupies six times as much space (rather than three times as per the basic reaction) as a single mole of a gas, coupled with it now being nowhere near “room temperature and pressure” because of the initial detonating explosion.
One mole of a gas - occupies 24 litres of space… Since 80 grams of reactant become six moles of gas, we’re talking 144 litres of space instantaneously trying to occupy the space that only the 80g of starting product occupied, hence the enourmous explosion, with the resulting cloud being full of “half-reacted” products, especially un-reacted NO2.
Many more lives would have been lost - had this poison gas cloud come down as “fallout” across the populated land, rather than moved out to sea.
“Bhopal India” - springs to mind where between 4000 and 20000 deaths were caused by the poison gas cloud (Methyl isocyanate in this case) alone. 
It is also rather alarming that NO2 happens to greatly reduce one’s natural resistance to COVID-19 as well, if you will “Instant Pre-Existing Condition” if you happen to breath this noxious gas, which is already know to also cause things like Pumonary Edema, a very nasty respiatory ailment likely to completely ruin one’s life in itself.
Humanity should be avoiding NO2 as much as it supposedly avoids Covid-19 in my mind.
If you can actually SEE the brown gas - DO NOT INHALE is the simple advice.
I am also alarmed to have found that previously reputable Chemistry sites on the web have tried to “downplay” this ability of Ammonium Nitrate to decompose passing through a Nitrogen Dixide stage, as if “That cannot happen”.
Well, the proof was there for the whole world to see… The only other “Brown Gas” I’ve ever heard of is Bromine Vapour, which one most definitely will NOT get out of NH4NO3 under ANY circumstances.