The debris of the municipal school of Bento Rodrigues district, which was covered with mud after a dam owned by Vale SA and BHP Billiton Ltd burst, is pictured in Mariana, Brazil, November 10, 2015. REUTERS/Ricardo Moraes/File photo - RTSR4R2

BRASILIA (Reuters) - A federal judge in Brazil has agreed to hear a criminal case against four companies and 22 employees for a burst tailings dam at the Samarco mine that killed 19 people last November, according to a court document seen by Reuters on Friday.

Prosecutors last month accused Samarco, its joint-venture owners Vale SA and BHP Billiton, and consultant VogBR of environmental crimes, while employees were accused of homicide in the disaster, which also polluted a major river.

Prosecutors said there were signs that the dam was unsafe for several years before its collapse but Samarco officials, executives, employees and board members appointed by Vale and BHP failed to take proper action.

The court document, signed by federal judge Jacques de Queiroz Ferreira and dated Wednesday, said the defendants had 30 days to present their defense.

Vale and Samarco repeated their rejection of the charges.

BHP also rejected the charges, saying in a statement that the court decision was only a procedural stage that did not “analyze the merits of the charges.” VogBR did not immediately respond to requests for comment.

Samarco said investigations into the cause of the spill showed it did not have prior knowledge of any risks to the structure of the dam.

The spill is considered the largest environmental disaster in Brazilian history. The dam collapse released millions of tonnes of muddy mine waste known as tailings, leaving hundreds homeless and polluting the Rio Doce river.