TUNIS, Tunisia (AP) — A top official in the Tunisian coastal city of Mahdia says the prison director there freed about 1,000 inmates following a deadly rebellion.

The official says soldiers at the prison opened fire on the inmates after they rebelled Saturday, setting fire to mattresses and other objects. The official estimates that five people were killed.

The official said the prison director then decided to open the prison gates to prevent further bloodshed. He was speaking on condition of anonymity out of security fears.

The exchange came soon after Tunisia swore in a new interim president on Saturday. The North African country has been grappling with looting and widespread unrest after protests forced President Zine El Abidine Ben Ali to flee on Friday.