The exact cause of the Beirut explosions remains to be determined definitively, but Lebanese officials have linked the blasts to a stockpile of ammonium nitrate kept in a warehouse in the city’s port.

Tuesday’s explosion left at least 135 people dead, thousands injured and as many as 300,000 displaced, and reduced a section of the city to rubble.

According to legal documents, court correspondence and statements by public officials obtained by The Washington Post, the stockpile of 2,750 tons of ammonium nitrate arrived in Beirut in 2013. Despite warnings over the stockpile’s volatile nature, it remained in storage for years amid a metropolitan area with a population of more than 2 million.

What is ammonium nitrate?

The chemical compound is a white salt and an oxidizer — it fuels fires by supplying oxygen. Without a detonator, pure ammonium nitrate does not explode, which is why it is considered safe to use as an agricultural fertilizer.

However, when mixed with carbons such as fuel oil, it can be used for commercial explosions, for mining and other purposes.

Has it played a role in other major explosions?

Ammonium nitrate accidents are rare. But the chemical compound is often stored in large quantities because of its large-scale commercial applications. So when things go wrong, they sometimes go very wrong.

In 1921, a fertilizer explosion at a chemical plant in Oppau, Germany, opened a crater over 60 feet deep. It could be heard more than 200 miles away.

In 1947, a stockpile of the chemical compound exploded in the port of Texas City, Tex., triggering a 15-foot wave and leaving hundreds of people dead. At the time, the ignition of the blast was attributed to 2,300 tons of the compound.

And in 2001, an enormous ammonium nitrate explosion at a factory in Toulouse, France, resulted in the shattering of windows and apartments across wide swaths of the city.

Explosions flattened parts of Tianjin, a Chinese port city, in 2015, killing more than 170 people and injuring hundreds. Chinese investigators blamed the improper storage of chemical compounds, including ammonium nitrate

A range of terrorist groups have also used the compound to carry out attacks.

How dangerous is it?

“Ammonium nitrate is not the greatest explosive in the world,” Marc-Michael Blum, who headed the Organization for the Prohibition of Chemical Weapons laboratory until last year, told The Washington Post. “It is not a harmless substance,” he added.

One factor, he said, links many past accidental explosions: improper handling.

If “the ammonium nitrate fertilizer has been exposed to water evaporation or prolonged heating and the containment equipment is poorly insulated, the concentration of explosive substance will increase, thereby increasing the probability of explosion in a confined space,” Jingde Li, a gas explosion expert at Curtin University in Western Australia, told the Science Media Exchange. “Given most storage facilities are made of metals, they are susceptible to corrosion. Metal corrosion can produce chromates, chromium compounds and chlorides, which are dangerous explosion catalysts.”

Blum added that the prolonged storage of ammonium nitrate can make it suck in water, turning it into a “solid mass.”

In that state, ammonium nitrate becomes more likely “to detonate in bulk” than in its granular form.

Storage of ammonium nitrate with organic materials — especially liquids that can leak and readily mix, such as vegetable or fuel oil — poses particular risks, Blum said.

How is it regulated?

Because of its role in terrorist bombings — including in the 1995 Oklahoma City bombing — many governments have imposed restrictions on the compound’s purchase and storage.

“If you store or handle fertilizer, you must secure it to prevent it from being stolen,” the British National Counter Terrorism Security Office cautioned in 2014.

Besides limiting access, some countries or blocs such as the European Union have imposed strict rules on how to store the compound safely. In the United States, journalists and advocates have presented concerns that regulations are insufficient. According to a report by the Center for Public Integrity published in January, efforts to increase ammonium nitrate storage oversight have often failed, and data on how much of it is kept across the country is largely unavailable.

In U.S. ports, over which the Coast Guard has regulatory oversight under the Espionage Act of 1917, Coast Guard officials monitor the storage of the compound.

Concerns over storage are most dire, however, in countries with chronically weak governance and endemic corruption.

To store ammonium nitrate under less-than-deal conditions and over prolonged periods, Blum said, is never safe.

“If you do that right in the center of a big metropolis, then that’s of course asking for a disaster,” he said.