RABAT: Morocco has evacuated more than 50,000 people, nearly half the population of the northwestern city of Ksar El-Kebir, as flooding driven by ​weeks of heavy rain threatened to inundate the city, state media said on Monday.

“The city has become a ghost town,” local resident Hicham Ajttou told Reuters by phone. “All markets and shops are closed and most residents have either left voluntarily or been evacuated.”

Authorities set up shelters and temporary camps and ‌barred entry into ‌Ksar El-Kebir as rising water ‌levels ⁠in ​the ‌Loukkos River spread across several neighborhoods. Only departures from the city were permitted, while electricity was cut in parts of it and schools were ordered to remain closed until Saturday.

Officials said the floods were partly triggered by water released from the nearby Oued Makhazine dam, which ⁠had reached full capacity. Ksar El-Kebir lies about 190 km (120 miles) ‌north of Rabat.

Ajttou said he moved his ‍family to Tangier last ‍week and returned to Ksar El-Kebir to volunteer ‍in relief efforts.