Ports around the world are working to remove potentially dangerous chemicals, sometimes stored in huge quantities, following an explosion in Beirut this month that left at least 180 people dead, thousands injured and hundreds of thousands displaced.

Officials in Dakar, Senegal’s capital city, announced Thursday they had requested the removal of almost 3,000 U.S. tons of ammonium nitrate from the city’s port — a larger volume of the chemical compound that caused Beirut’s explosion.

Last week, Romanian officials at the Black Sea port of Agigea said they had found a single warehouse illegally holding about 5,000 tons of ammonium nitrate. A further 3,800 tons of the compound had been found in raids across the country, police said in a statement.

As the dust settled after the Beirut blast, which many first took for an attack, a more mundane apparent culprit emerged: government inaction, incompetence and corruption.

Some 2,750 tons of ammonium nitrate had been stored in unsafe conditions at the city’s port since 2013 — despite warnings that the chemical fertilizer could turn into a potent explosive if not stored or disposed of correctly.

For many countries, the Beirut explosion was a wake-up call.

“What happened in Beirut made us examine our own situation, and we actually got rid of large quantities of abandoned and neglected and dangerous materials that were in the ports,” Mohamed Mait, Egypt’s finance minister, told the country’s parliament last week, Reuters reported.

Ammonium nitrate is generally considered safe for use as an agricultural fertilizer, but it can be dangerous depending on how it is stored. It has caused deadly explosions around the world, including a 1947 blast in Texas City, Tex., that left hundreds dead.

The global ammonium nitrate trade is worth billions of dollars every year. It travels along complex international supply chains. Only a small number of countries produce the compound (Russia is the largest of them), but many use it.

Ammonium nitrate often travels by sea, which means it is prone to be left sitting in densely populated cities with ports, such as Beirut and Dakar. Many countries have imposed restrictions on how it can be stored, but amid the chaos of global trade, it can be hard to keep track of.

Romanian police announced a countrywide operation to find illegally stored ammonium nitrate earlier this month. After 51 inspections over three days, they confiscated almost 9,000 tons of the compound, according to a statement released last week. Several criminal investigations had been started because of the discoveries, police said.

This appears to be only a small fraction of the ammonium nitrate in Romania. The country’s Maritime Ports Administration said that some 28,000 tons of the chemical is kept at the country’s largest port, Constanta.

Companies storing the compound had been asked to draw up safety plans, the port said in a statement.

Ammonium nitrate can continue to pose a problem for governments after its seizure. In Beirut, the ammonium nitrate at the port came from a ship called the MV Rhosus, but the ship was abandoned and remained there.

Other ports have seen similar problems. In India’s Chennai, port officials acknowledged this month they had been storing more than 800 tons of ammonium nitrate since its seizure in 2015.

Some of the load was moved to Hyderabad via trucks last week. According to newspaper the Hindu, 10 containers were taken, accompanied by guards and the trucks equipped with dry chemical powder fire extinguishers.

In some ports, getting rid of the chemicals may not be easy. In Senegal, Dakar was the point of entry for ammonium nitrate bound for Mali — a landlocked West African neighbor, the government of which was overthrown in a military coup Tuesday. Its neighbors closed their borders in response.