Libya’s chief prosecutor has ordered the detention of eight current and former officials pending his investigation into the recent flood disaster that killed thousands, his office said.

Two dams outside the city of Derna collapsed last month, sending a wall of water several metres high through the city and leaving thousands of people dead.

The dams broke up on September 11 after they were overwhelmed by Storm Daniel, which caused heavy rain across eastern Libya. The failure of the structures inundated as much as a quarter of the city, officials have said, destroying entire neighbourhoods and sweeping people out to sea.

More than 3,800 people died in the disaster, according to the latest official toll, and international aid groups have said 10,000 or more people may be missing.

A statement on Monday by the office of General Prosecutor Al-Siddiq Al-Sour said prosecutors on Sunday questioned seven former and current officials with the Water Resources Authority and the Dams Management Authority over allegations that mismanagement, negligence and mistakes contributed to the disaster.

Derna Mayor Abdulmenam al-Ghaithi, who was sacked after the disaster, was also questioned, the statement said.

The eight former and current officials did not provide evidence to spare them from potential charges, and prosecutors ordered them jailed pending the completion of the investigation, the statement added.

The chief prosecutor said eight other officials would be summoned for questioning.

Al-Sour said last week that the two dams upstream from Derna had been cracked since 1998.

But repairs begun by a Turkish company in 2010 were suspended after a few months when Libya’s 2011 uprising flared, and the work never resumed, the prosecutor said, vowing to deal firmly with those responsible.

According to his office, the investigation is focused on a dam maintenance contract reached between the Turkish firm and Libya’s water department.

The investigation could face daunting challenges due to Libya’s years of political division. Mounting calls for an international investigation into the disaster reflect the deep public mistrust in state institutions.

The oil-rich North African nation has been in chaos since 2011, when a NATO-backed uprising toppled longtime ruler Muammar Gaddafi, who was later killed. For most of the past decade, rival administrations have claimed authority to lead Libya.

The country’s east has been under the control of General Khalifa Haftar and his self-styled Libyan National Army, which is allied with a parliament-confirmed government. A rival administration is based in the capital, Tripoli, and enjoys the support of most of the international community.

Two weeks after the dams collapsed, local and international teams were still digging through mud and hollowed-out buildings to look for victims. They also are combing the Mediterranean Sea off Derna for the bodies of people who were swept away.

The flood of water from the dams left as much as one-third of Derna’s housing and infrastructure damaged, according to the United Nations Office for the Coordination of Humanitarian Affairs (OCHA). Authorities have evacuated the most impacted part of the city, leaving only search and ambulance teams, the UN office said.

The storm hit other areas in eastern Libya, including the towns of Bayda, Susa, Marj and Shahat. Tens of thousands of people have been displaced in the region and have taken shelter in schools and other government buildings.