Located near the border with Algeria, Oujda is where the Moroccan and Algerian railways join one another. The city was founded in 994/384 AH by Zenata chief Ziri ibn Atiyya. It has subsequently been fought over by fought over by Imazighen, Arabs, and the Ottomans.