Vale CEO Fabio Schvartsman in a helicopter over the site of the Jan. 25 Córrego de Feijão tailings dam collapse. Courtesy of Vale

Brazil is banning the use of upstream tailings dams in response to catastrophic collapses at two of them in the last four years.

All of the country’s 88 upstream dams will need to be decommissioned or removed by August 2021, according to a resolution from Brazil’s National Mining Agency.

Mining companies that own them will have until Aug. 15 to draw up decommissioning plans, which, according to the agency, should include either construction of a downstream dam or retention pond downstream of the existing dam, and until Feb. 15, 2020 to reinforce the dams.

Upstream tailings dams incorporate tailings materials into the dam for support as operators progressively add raised lifts to the dam structure. While less costly to construct than other dam designs, upstream dams may be less stable because the tailings being used for support can liquefy and lose their strength.

Related: United Nations report examines ways to end mining tailings disasters

The tailings dam collapse at Vale’s Córrego do Feijão in late January has so far killed 169 and left 141 missing. Several Vale employees and contractors, and four staffers of German consulting firm Tüv Süd, have since been arrested, and Vale has been hit with a string of court-mandated asset holds, fines and lawsuits.

Vale evacuated about 200 people from an area near an inactive tailings dam at its Mar Azul mine in Minas Gerais on Saturday as a preventive measure. The evacuation came after a separate company responsible for the dam’s decommissioning “detected that the geotechnical and geological model could be different from that used today,” Vale said.

The dam is one of Vale’s ten upstream dams that it said it would decommission over the next three years, at a cost of 5 billion reis ($1.775 billion).

Córrego do Feijão was the second dam collapse at a Vale-owned mine in four years. In November 2015, the collapse of an upstream tailings dam at Vale and BHP's joint venture Samarco mine killed 19.