The mining giant Vale and BHP Billiton’s joint venture is blocked by a judge to ensure that they pay the damage which was caused by a dam bursting last month, killing 17 people from its toxic waste.

The Anglo-Australian and Brazilian companies are the joint owners of Samarco which is a firm that functions iron ore tailing dam, the Guardian reported. The bursting of a dam in its mine created havoc in Minas Gerais, Brazil on November 5.

Consequently, on Friday a ruling was issued by a judge in Minas Gerais and it was decided that Vale and Billiton was responsible for the disaster in the mine, Yahoo! noted. The companies have to pay $5 billion as compensation to the government. The money will be used for the cleanup and as compensation to the villagers.

The dam explosion is regarded as the worst environmental disaster in Brazil in which 17 people lost their lives due to the toxic release. Hundreds of families became homeless as it completely buried the Bento Rodrigues village. The toxic release then rushed into Rio Doce Basin, which is one of the most important rivers of Brazil and rich in flora and fauna.

In the hearing, the judge said that although Samarco did not have the money charged as compensation, its parent companies would have to pay the money for cleanup and compensation. The judge also asked the companies to make an initial deposit of $502,000.

The judge ordered Vale and BHP to come up with plans for environmental recovery of the Rio Doce and rehabilitation of the villagers.

The Business Insider reports that till now no particular cause of the disaster can be found but prosecutors have said that it was due to “negligent licensing and lax regulations”. On the other hand, the legislators and mining experts have emphasized the fact that long pending renewal of Brazil’s mining codes is the main cause behind the crisis.