Zirid dynasty
H.H. Abdul Wahab identified Bir El Hafey with the medieval city of Jamunis (aka "Jamūnis al-Sābūn"), one of the main cities of the Qammuda region. Jamunis is first mentioned in the 10th century, when it became the capital of Qammuda under the Zirid dynasty, replacing the nearby city of Madhkur, which had been sacked by the forces of Abu Yazid. However, Jamunis was probably an important city before this. It was the site of a battle in 1030 between the Zirid ruler al-Mu'izz ibn Badis and the Zenata Berbers, which al-Mu'izz won. Jamunis is no longer mentioned after the 11th century, having been sacked by the Banu Hilal.