A top Libyan official has called for an investigation into the collapse of two dams in eastern Libya and the catastrophic floods that followed, pummeling parts of the country’s northeast and killing thousands.

“We asked the attorney general to open a comprehensive investigation into the events of the disaster,” Mohamed al-Menfi, the head of Libya’s Presidential Council, said in a social media post late Wednesday. He added that “everyone who made a mistake or neglected either in abstaining or taking actions that resulted in the collapse of the dams in the city of Derna” would be held accountable.

Over the weekend, torrential rains from Storm Daniel burst through two dams near Derna, on Libya’s northeastern coast, destroying much of the city and carrying entire neighborhoods into the sea. The floods damaged many roads and bridges, impeding access to the most stricken areas, with rescue efforts also complicated by the fact that Libya is ruled by rival governments.

The call for accountability by Mr. al-Menfi’s council, based in the west of Libya, came as the Libyan National Army, the main authority in the divided country’s east, including Derna, had closed entrances into the city and was allowing only rescue crews and aid convoys to enter. The previous day the army had urged surviving residents to leave the city.

The investigations should “extend to everyone who obstructed international relief efforts or their arrival in the stricken cities,” Mr. al-Menfi said.

It was unclear how an investigation would be conducted and how much accountability Libyans could hope to see in a country where infrastructure has been allowed to degrade as for more than a decade as rival authorities have focused on jockeying for power.

In a late-night news conference, the interior minister of the government in eastern Libya, Essam Abu Zeriba, announced that the number of documented dead was more than 2,700 and that more than 2,500 people were reported missing.

Libyan authorities have previously said that the death toll from the flood could be more than 5,000 and that more than 10,000 people remained missing.

The discrepancy between the official numbers and the projected death toll underlined the chaos and disorganization of a catastrophic natural disaster that struck a country divided by rival governments. Libya has suffered more than a decade of conflict, power struggles and dysfunction in the wake of the Arab Spring revolution that deposed the country’s longtime dictator, Col. Muammar el-Qaddafi.

The country is split between the internationally recognized government in the western half based in Tripoli, the capital, and the separately administered region in the east.

On Wednesday night, the mayor of Derna, Abdulmenam Al-Ghaithi, told Al Arabiya television that the death toll could reach 20,000, based on the number of districts wiped out.

Three days after the dams first broke, Mr. Abu Zeriba also announced on Wednesday the formation of a joint operations room to oversee the response in cooperation with the security forces.

It was an indication of how the disaster response was hampered in its early days.

Libya was poorly prepared for Storm Daniel, which displayed its destructive power last week in Greece, Turkey and Bulgaria, killing more than a dozen people, before sweeping across the Mediterranean Sea, pummeling its coastline and destroying poorly maintained infrastructure.