IIRC the report at the time was that ship that brought the cargo to Beirut was bound for Mozambique and the ammonium nitrat was said to be for use as fertilizer. The ship was arrested and the cargo eventually confiscated by the Lebanese Government and stored at the port for several years, before the explosion.(??)
Yes, ammonium nitrate was/is used in onshore seismic operation as explosive, but then shipped in prepared ready mixed primary charges and declared as hazardous cargo.
A secondary charge and blast cap is required to set off the explosion. Those are shipped separately as explosives. (At least that is my experience from carrying this as cargo in Indonesia)
PS> As fertilizer it is shipped in bags/big bags and regarded as non-hazardous cargo.