The Battle of Tahert occurred in 790 when Idris I marched eastward from Tlemcen and made an unsuccessful attempt to overthrow the Rustamids at their capital.
In 790 Idris I marched eastward to Tlemcen. The people of Tlemcen opened its gates for him and pledged allegiance to him, enabling him to seize the city without a fight.
Following his seizure of Tlemcen, he directed his efforts towards the Rustamid capital of Tahert. He attempted an attack against Tahert, however he failed under its walls as a result of its strong defenders. Following this failure, he returned to Walila and left a governor in Tlemcen to represent him.
Despite this attempt, the Rustamids did not face any serious threat from their neighbours in the ninth century.