CAIRO, EGYPT -- A court in Libya on Sunday sentenced 12 current and former officials to terms of up to 27 years in prison over their involvement in the collapse of two dams last year that sent a wall of water several metres high through the centre of a coastal city. Thousands of people died.

The two dams outside the city of Derna broke up on Sept. 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.

The Derna Criminal Court on Sunday convicted 12 current and former officials of mismanagement, negligence and mistakes that contributed to the disaster, according to a statement from the office of the country's top prosecutor.

The defendants, who were responsible for managing the country's dams, were given prison terms that ranged from nine to 27 years, the statement said, without identifying them. Three of the defendants were ordered to return "money obtained from illicit gains," the statement said without elaborating.

The court acquitted four other people, it said.

Sunday's verdict could be appealed before a higher court, according to Libya's judicial system.

The oil-rich North African nation has been in chaos since 2011 when a NATO-backed uprising-turned-civil war ousted longtime dictator Moammar Gadhafi, who was later killed. For most of the past decade, rival administrations have claimed authority to lead Libya. Each is backed by armed groups and foreign governments.

The country's east has been under the control of Gen. Khalifa Hifter 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.

The dams were built by a Yugoslav construction company in the 1970s above Wadi Derna, a river valley that divides the city. They were meant to protect the city from flash floods, which are not uncommon in the area. The dams were not maintained for decades, despite warnings from scientists that they could burst.

A report by a state-run audit agency in 2021 said the two dams hadn't been maintained despite the allocation of more than US$2 million for that purpose in 2012 and 2013.

The flood of water from the dams left as much as one-third of Derna's housing and infrastructure damaged, according to the U.N.'s Office for the Coordination of Humanitarian Affairs, or OCHA.

The World Health Organization said more than 4,000 flood-related deaths have been registered, but the head of Libya's Red Crescent previously cited a death toll of 11,300. OCHA said at the time that along with the registered deaths, there were at least 9,000 missing people.