— Luiz de Castro was installing lamps at a mining complex in Brazil late last month when a loud blast split the air. He figured it was just a truck tire popping, but a friend knew better.

“No, it’s not that!” the friend said. “Run!”

Dashing up a staircase, caked in mud and pelted by flying rocks, Mr. Castro clambered to safety. But as he watched, a wall of mud unleashed by the collapse of a mining dam swallowed his co-workers, he said. Tiago, George, Icaro — they and at least 154 others, all buried alive.

The deluge of toxic mud stretched for five miles, crushing homes, offices and people — a tragedy, but hardly a surprise, experts say.

There are 87 mining dams in Brazil built like the one that failed — enormous reservoirs of mining waste held back by little more than walls of sand and silt. And all but four of the dams have been rated by the government as equally vulnerable, or worse.

Even more alarming, at least 27 sit directly uphill from cities or towns, with more than 100,000 people living in especially risky areas if the dams failed, an estimate by The New York Times found.

In the disaster last month, all the elements for catastrophe were there: A bare-bones reservoir of mining waste built on the cheap, sitting above a large town nestled underneath. Overlooked warnings of structural problems that could lead to a collapse. Monitoring equipment that had stopped working.

And perhaps above all, a country where a powerful mining industry has been free to act more or less unchecked.

The threat of poorly constructed mining dams in Brazil goes far beyond one company. The latest deadly failure — the second in Brazil in three years — has made it clear that neither the mining industry nor regulators have the situation under control.

Collapsed dam Flow of mud Mine headquarters Farmland Hotel Residential area Approx. 5 miles from dam Paraopeba River Collapsed dam Flow of mud Mine headquarters Hotel Farmland Residential area Approx. 5 miles from dam Paraopeba River

Vale S.A., the world’s largest iron ore producer, says it will close all 10 of its dams in Brazil with a design similar to the one it ran in the town, Brumadinho. Still, the company, which bought the mining complex in 2001, defended its management of the dam, which had been sitting there, inactive, since 2016.

“The dam had a safety factor in accordance with the world’s best practices,” Vale said in a statement. The structure, it said, had been inspected regularly, ​and the reports “attest to the physical and hydraulic safety of the dam.”

But questions about the safety of the dam had been brushed aside for years. Despite them, the company had managed to get its plan to expand the mining complex in Brumadinho fast-tracked for approval by local officials.

“When you have this sort of structure upstream of a population center, that sends up all sorts of red flags,” said William F. Marcuson III, a former president of the American Society of Civil Engineers.

TEXT Córrego do Feijão Mine N 2,000 feet Collapsed dam Dam 6 Ore treatment plant Railroad ring Damaged or destroyed structures Rescue center Mine headquarters Cafeteria Nova Estância bed and breakfast Farmland Collapsed rail bridge Parque da Cachoeira neighborhood Paraopeba River

The New York Times | Satellite imagery via DigitalGlobe

The Solidity of Mud

It is one of the oddest structures known to engineering — and, unless it is designed, constructed and monitored with great attention to detail, one of the most terrifying.

Dams like the one that collapsed in Brumadinho are, in essence, lakes of thick, semi-hardened mud consisting of water and the solid byproducts of ore mining, which are known as tailings.

Antonio Lacerda/EPA, via Shutterstock

Like any dam, they can fail in a number of unsurprising ways. They can overtop if filled too quickly. They can spring a leak, or sustain damage in an earthquake. Or they can fall victim to sloppy construction or maintenance.

But they are not like any dam.

Indeed, the structure at Brumadinho strained the very definition of “dam.” It had no separate concrete or metal wall to hold back its contents. Instead, the structure, known as an upstream tailings dam, relied on the lake of mud to remain solid enough to contain itself.

1 The Brumadinho dam was born, its plans show, as a relatively modest mound of compacted material that acted like a dike. Starter dike is made of compacted dirt. Tailings 2 When the dam was opened for business, waste from the mine was piped in behind the starter dike and subsequent dikes. The tailings are mixed with water and piped into the dam area. New dikes are built on top of solidified mud tailings as the dam grows. 3 As the mud lake grew, new dikes were built upstream to hold it. Several dikes are made of compacted tailings. Water table Engineers added a setback to address problems with seepage in the lower parts of the dam. High water pressure could potentially breach the dam and help produce liquefaction. SECTIONS OF THE DAM 1 The Brumadinho dam was born, its plans show, as a relatively modest mound of compacted material that acted like a dike. Starter dike is made of compacted dirt. Tailings 2 When the dam was opened for business, waste from the mine was piped in behind the starter dike and subsequent dikes. The tailings are mixed with water and piped into the dam area. New dikes are built on top of solidified mud tailings as the dam grows. 3 As the mud lake grew, new dikes were built upstream to hold it. Several dikes are made of compacted tailings. A setback was added to address problems with seepage in the lower parts of the dam. Water table High water pressure could potentially breach the dam and help produce liquefaction. SECTIONS OF THE DAM 1 The Brumadinho dam was born, its plans show, as a relatively modest mound of compacted material that acted like a dike. Starter dike is made of compacted dirt. Tailings 2 When the dam was opened for business, waste from the mine was piped in behind the starter dike and subsequent dikes. The tailings are mixed with water and piped into the dam area. New dikes are built on top of solidified mud tailings as the dam grows. 3 As the mud lake grew, new dikes were built upstream to hold it. A setback was added to address seepage problems in the dam. Water table Several dikes are made of compacted tailings. SECTIONS OF THE DAM The New York Times | Note: Diagram is based on a 2010 master’s thesis by Washington Pirete and a 2018 report by Tüv Süd.

“Basically they are like landfills, but wet landfills,” said Gregory B. Baecher, a member of the National Academy of Engineering and a professor at the University of Maryland.

The dams’ unique construction makes them vulnerable to a bizarre and potentially devastating process called liquefaction. When that happens, a solid material seemingly resting safely in place can abruptly become a murky liquid, flowing downhill and destroying nearly everything in its path.

Even a subtle change, like an increase in water content because of especially heavy rains, say, or poor management, can create enough internal pressure to push apart the solid tailings and liquefy the mud.

The people of Brumadinho know all too well what can happen next.

“The forces are absolutely phenomenal,” said Dirk Van Zyl, a professor of mining engineering at the University of British Columbia, who investigated a 2014 collapse of a tailings dam in Canada. “You really have to see it to understand.”

A video of the Brumadinho collapse makes clear that the mud behind the dam did liquefy, experts who have seen it said. What is not clear is whether liquefaction caused the collapse, or followed it.

The video appears to show where the dam failure began.

B A C Areas where the dam appears to have collapsed first “It started as a pinpoint,” said Mr. Marcuson, the former engineering society president, “and maybe in one second it looked like a whole patch down there.” Very rapidly, he said, “the dam fails and the tailings pour out and the dam goes to hell in a matter of seconds. And the dam just crumbles up.” N TOP VIEW OF THE DAM The mud tailings started to liquefy and flow down the valley. 3 Extent of the mudflow B Dam face Entire face of the dam started to collapse 2 C A Dam started to collapse in these areas at the lower and top dikes 1 B A C Areas where the dam appears to have collapsed first “It started as a pinpoint,” said Mr. Marcuson, the former engineering society president, “and maybe in one second it looked like a whole patch down there.” Very rapidly, he said, “the dam fails and the tailings pour out and the dam goes to hell in a matter of seconds. And the dam just crumbles up.” N TOP VIEW OF THE DAM The mud tailings started to liquefy and flow down the valley. 3 Extent of the mudflow B Dam face Entire face of the dam started to collapse 2 C A Dam started to collapse in these areas at the lower and top dikes 1 B A C Areas where the dam appears to have collapsed first “It started as a pinpoint,” said Mr. Marcuson, the former engineering society president, “and maybe in one second it looked like a whole patch down there.” Very rapidly, he said, “the dam fails and the tailings pour out and the dam goes to hell in a matter of seconds. And the dam just crumbles up.” N TOP VIEW OF THE DAM Extent of the mudflow 3 The mud tailings started to liquefy and flow down the valley. B Dam face Entire face of the dam started to collapse. 2 C A Dam started to collapse in these areas. 1 The New York Times | Note: Diagram is based on a 2010 master’s thesis by Washington Pirete and a 2018 report by Tüv Süd.

Mr. Van Zyl said: “Ultimately everything liquefies and it’s gone. It’s pretty darn bad.”

Many engineers cautioned that it was too soon to draw firm conclusions about what precisely went wrong with the structure in Brumadinho, called Dam I of the Córrego do Feijão Mine. And they said it was possible to build upstream tailings dams safely.

“There’s nothing blatantly wrong with this method of construction,” said W. Allen Marr, founder and chief executive of Geocomp, based in Boston, and a member of the national academy. When the structures fail, Mr. Marr said, “it’s usually a combination of several things that should have been done but don’t get done.”

In 2010, Washington Pirete, whose LinkedIn profile and a professional publication list him as a longtime Vale employee, wrote a master’s thesis focused on the dam at Brumadinho. Mr. Pirete concluded that the risks of liquefaction were low to moderate, but several engineers say now that his analysis, if anything, cast doubt on the safety of the dam.

Douglas Magno/Agence France-Presse -- Getty Images

Mr. Marr said that Mr. Pirete’s safety calculations “raise questions about the stability of the dam.” Mr. Van Zyl said that if he had calculated the safety margins Mr. Pirete found for the dam, “I wouldn’t sleep well.” He said his first reaction on seeing the thin margins was that the dam “should have failed earlier, almost.”

Mr. Pirete did not respond to several requests for comment.

The thesis describes a method of construction, which began in 1976, that is in many ways routine for upstream dams.

A so-called starter dike was built across the valley above Brumadinho, and the mining company piped waste behind it. When the waste neared the top of the dike, the company built another slightly uphill — hence the name upstream construction. The second dike sat directly on the hardened mud.

Over the decades, a towering structure rose over the mining complex, its integrity dependent entirely on the solidity of the mud.

A closer look at Mr. Pirete’s figures, some of which were scarcely above the collapse threshold, left some engineers questioning how Mr. Pirete could have considered the dam safe.

“That’s way too close to the margin,” Mr. Baecher said.

Last year, a German company hired by Vale took its own look at the dam and calculated higher stability factors than Mr. Pirete did — but it did raise safety concerns.

The company Tüv Süd found blocked drainage pipes and cracks, and made note of a small wooden structure that had been erected to stop part of the dam from slumping. The company also found water visibly seeping from at least one area, and said there was a risk of liquefaction.

To reduce the risk of triggering a collapse through vibrations, they advised Vale to avoid letting heavy equipment onto the dam or allowing detonations nearby. They also advised work to keep the water level from rising.

A Looming Threat

Two weeks after the Brumadinho tragedy, sirens went off in the middle of the night 76 miles away, in the town of Barão de Cocais. “Attention! This is a real dam break emergency,” loudspeakers blasted. “Abandon your homes immediately.”

The alarms wreaked havoc as nearly 500 people were ordered to evacuate. Vale, which owns the mining complex in Barão de Cocais, called it a “preventive measure,” explaining it had initiated its emergency plan after the consulting firm Walm refused to attest to the dam’s stability.

“We hope it doesn’t burst, but unlike many cities we had time to act,” said Décio dos Santos, the town mayor. “We didn’t know the dam was dangerous.”

The true risk of dams in Brazil — and elsewhere — is largely unknown.

Just as in Brumadinho, the dams above the now evacuated areas of Barão de Cocais and another town, Itatiaiuçu, are upstream dams. There are a total of 87 upstream dams throughout Brazil, and all but four have the same safety rating as the collapsed structure — or worse — according to government records.

Atlantic Ocean BRAZIL Site of dam collapse Rio de Janeiro São Paulo Upstream mining dams near populated areas Upstream mining dams Atlantic Ocean BRAZIL Upstream dams near populated areas Site of dam collapse Upstream dam Atlantic Ocean BRAZIL Site of dam collapse Upstream mining dams near populated areas Upstream mining dams By Scott Reinhard | Source: Agência Nacional de Mineração

Some of these poorly rated dams lie directly upstream from populated areas, an analysis by The Times found. At least 27 sit directly uphill from cities or towns, and could threaten them if they failed.

Upstream mining dams near populated places Dam Conselheiro Lafaiete Dam Conselheiro Lafaiete Crixás Dam Crixás Dam Igarapé Dam Igarapé Dam Dam Itaquaquecetuba Dam Itaquaquecetuba Dam João Monlevade Dam João Monlevade Dam Nova Lima Dam Nova Lima The New York Times | Satellite imagery via Google Earth

In Itatiaiuçu, just 20 miles west of Brumadinho, residents were also awoken in the pre-dawn hours on Friday. Authorities and representatives of the ArcelorMittal mining company went door to door in one neighborhood, ordering some 200 people to evacuate.

Here, too, the company said it had initiated its emergency plan after auditors adopted “a more conservative methodology” and refused to attest to the stability of a nearby dam — although the conditions themselves were unchanged.

A Company Town Says ‘Enough’

When the dam collapsed at the Córrego de Feijão mine shortly after noon, 11.7 million cubic meters of mining waste — enough to fill almost 5,000 Olympic swimming pools — descended toward the town below. As it did, it slammed into a company cafeteria, where there were a couple of hundred employees.

It took rescue workers days to reach them.

Antonio Lacerda/EPA, via Shutterstock

Vale is the main source of income for the 37,000 people living in Brumadinho, but as the death toll rose, public anger boiled over at the company.

Even run-of-the-mill activities became daunting, with a mass of thick brown sludge now cutting through the town.

Two days after the dam collapse, Mayor Avimar Barcelos described Vale as “incompetent and reckless.” Vale workers, once proud, felt subdued. One said he no longer felt comfortable wearing his uniform on the street.

“I’d be lynched,” he said.

At the entrance to town, a monument bore a scribbled accusation: “Murderous Vale!!!”

AP

The company says it is still investigating what caused the rupture and insists there were no warning signs.

The dam had been inactive for almost three years, according to Vale, and had been certified as stable in September, despite warnings in a 2015 environmental impact study that some of the monitoring instruments were faulty.

Three years ago, a similar dam burst in the city of Mariana, 75 miles away, killing 19 people and unleashing one of the worst environmental disasters in Brazilian history. That dam was jointly owned by Vale and the Anglo-Australian mining company BHP.

After the Mariana collapse, officials vowed to adopt rigorous safety protocols. That never happened.

In Brazil, given the dearth of government inspectors, companies are allowed to self-regulate, hiring independent auditors to verify dam safety through regular inspections and an analysis of written records — all provided by the company.

Experts say that creates a conflict of interest.

“You can’t have the person doing the inspection getting paid by the company he is inspecting,” said Evandro Moraes da Gama, a professor of engineering at the Federal University of Minas Gerais who specializes in mining waste.

Four days after the Brumadinho dam burst, the police arrested the outside inspectors who had attested to its stability, along with three Vale employees responsible for safety and environmental licensing. A judge later ordered them released.

“They’re taking it out on the inspectors, arresting them, but it’s the system that’s flawed,” Mr. Gama said.

Many residents of Brumadinho believe that the failure of the company’s warning system cost many lives. In a statement, Vale said the “speed at which the event occurred made it impossible to trigger the sirens.”

Mr. Castro, the Vale employee who escaped the deluge, said, “If the alarm had sounded, the environmental tragedy would still happen, but no one would have died.”

Jefferson Ferreira dos Passos, whose sister worked at an inn downhill from the dam, said that when he heard it had burst, he immediately called her. When she didn’t answer, Mr. Passos ran four miles to the site — only to find an expanse of mud.

He and another man started carrying survivors out of the sludge. When they found a woman clinging to a tree trunk with her legs broken, they waited by her side until a helicopter airlifted her out.

TV Record, via AP

He never found his sister.

Hooked on Mining

The first Portuguese explorers came searching for gold and diamonds in the state of Minas Gerais, whose name means “general mines.” It remains the hub of Brazil’s mining industry, producing 53 percent of the country’s output, with more mines and tailings dams than any other Brazilian state. Here, critics say, the laws are written by the mining companies, not for them.

Last December, an extraordinary meeting of the state council on mining regulations was called to vote on a proposal by Vale to expand operations at Córrego de Feijão and another mine. The proposal had been declared a “priority” by the state.

Vale bought the mining complex in 2001. Antonio Lacerda/EPA, via Shutterstock

Maria Teresa Corujo, an activist who represents the community vote on the council, angrily pointed out that council members had been given just four business days to pore over thousands of documents.

“The environmental management of our state continues to be focused on the G.D.P. index, on mining interests,” she said, according to minutes of the meeting that were sent to The Times. “This is destroying Minas Gerais.”

Júlio Cesar Dutra Grillo, the state representative from the federal environmental protection agency, warned the council that the dams were not risk free. “Any negligence on the part of those conducting risk management, and they rupture,” he said.

The proposal passed with one dissenting vote, from Ms. Corujo, and an abstention by Mr. Grillo.

The board's decision came despite growing concern about accidents after the Mariana dam collapse. In public hearings, activists in Brumadinho would try to convince residents that tourism, not mining, was the city’s path forward.

But tourism is not what keeps the city spinning. Mining started here in the 1950s and many communities in the city were created by its workers.

Fernando Coelho, 35, was born in a small community inside the Córrego do Feijão mining compound. “My umbilical cord is buried there,” he said.

Mr. Coelho started working there alongside his father, Olavo Coelho, when he was 19, but was at home after a night shift on the day the dam broke. He knew his father would be having lunch at the cafeteria and rushed to his car. When he got there, all he found was mud.

Mr. Coelho said he was desperately sad — but angry, too. Months before the collapse, his father had been called in to fix a leak. Ever since then, according to his son, he had been saying the dam was not safe.

“He warned the dam could burst,” he said. “But he isn’t the one making decisions.”

Mr. Coelho said he told the prosecutors in charge of the investigation what his father had told him. Three other workers also told The Times they were aware of leaks.

But Mr. Coelho said that despite his father’s warnings, he had never worried the dam would break. His whole life, after all, revolved around the mining complex. He feels differently now.

“I won’t ever go back,” he said. “It killed my father.”

Before the dam collapsed After the collapse Mud flow Before the dam collapsed After the collapse Mud flow Before After Flow Before the dam collapsed After the collapse Mud flow The New York Times | Satellite imagery via DigitalGlobe

In the days after the rupture, Vale said it would give the families of each victim 100,000 reais, or $27,000, independent of any legal settlements.

State and national governments quickly called for stricter regulations, but, as experts point out, the outrage after the Mariana dam collapse did little to improve the regulatory framework.

“After Mariana, the system just got more flexible, facilitating the traffic of influence inside the licensing system,” said Klemens Laschefski, a Federal University of Minas Gerais professor who participates in the council meetings.

Douglas Magno/Agence France-Presse -- Getty Images

“I’ve been to 40 meetings on priority projects — not one was rejected,” he said.

Ademir Caricati, a community leader in a neighborhood where roughly 40 houses were destroyed, said that Vale officials told residents last year that the dam posed little danger.

The officials even offered an odd sort of reassurance, pointing out that the mine’s administrative offices were right below the dam.