There is some evidence of a settlement during the Roman occupation, which seems to have been under the control of Berbers rather than Romans.

The city was founded in 994 by Ziri ibn Atiyya, Berber chief of the Zenata Maghrawa tribe.
Ziri was, with his tribe, authorised to occupy the region of Fas, but feeling insecure in that region and that town, and wishing to be nearer to the central Maghrib homeland of his tribe, he moved to Wajda, installed there a garrison and his possessions, appointing one of his relatives as governor.
In the mid-11th century, a new quarter with a wall was allegedly added to the primitive core.
Yusuf ibn Tashfin occupied the city in 1079, and in the next century, it came under Almohad control, with its fortifications repaired and strengthened under the Almohad caliph Muhammad al-Nasir.

In the mid-11th century, Oujda acquired prominence through its strategic position on the road east from Sijilmasa.
Throughout the history of the dynasties of the Muslim West, Oujda played an important strategic role among the Merinids, settled in Fes, in this case as a rear base in their conflict with the Abdalwadids of the Kingdom of Tlemcen.

The city was rebuilt in the 13th century by sultan Abu Yusuf Yaqub.
The city experienced great difficulty in making peace with its neighbours to the east, and sometimes to the west, because of its position in respect to the clashes between the Saadi dynasty and the Ottomans of Algiers.
It was torn between the rulers of Fes and the rulers of Tlemcen, and from the 16th century, it was contested by the Alaouite dynasty.

The French occupied it in 1844 and again in 1859.
To the west of the city is the site of the Battle of Isly in 1844.
In 1907 and 1908 Oujda was reconquered by General Bugeaud and Marshal Lyautey and used as a French military base to control eastern Morocco.
The modern city owes much of its present form to the French, it developed along the roads built at that time.

The 1948 Anti-Jewish Riots in Oujda and Jerada occurred in this city.
The crowd, sparked off by a minor incident, poured into the Jewish quarter.
In the three hours that passed before the army could control the mob, five people (including one Frenchman) had been killed, 30 had been severely injured, shops and homes had been sacked.

The Moroccan border with Algeria is just east of Oujda; on the other side of the border is the Algerian town of Maghnia.
The border has been closed since 1994.
There is some evidence of a settlement during the Roman occupation, which seems to have been under the control of Berbers rather than Romans.
The city was founded in 994 by Ziri ibn Atiyya, Berber chief of the Zenata Maghrawa tribe. Ziri was, with his tribe, authorised to occupy the region of Fas, but feeling insecure in that region and that town, and wishing to be nearer to the central Maghrib homeland of his tribe, he moved to Wajda, installed there a garrison and his possessions, appointing one of his relatives as governor. In the mid-11th century, a new quarter with a wall was allegedly added to the primitive core. Yusuf ibn Tashfin occupied the city in 1079, and in the next century, it came under Almohad control, with its fortifications repaired and strengthened under the Almohad caliph Muhammad al-Nasir.
In the mid-11th century, Oujda acquired prominence through its strategic position on the road east from Sijilmasa. Throughout the history of the dynasties of the Muslim West, Oujda played an important strategic role among the Merinids, settled in Fes, in this case as a rear base in their conflict with the Abdalwadids of the Kingdom of Tlemcen.
The city was rebuilt in the 13th century by sultan Abu Yusuf Yaqub. The city experienced great difficulty in making peace with its neighbours to the east, and sometimes to the west, because of its position in respect to the clashes between the Saadi dynasty and the Ottomans of Algiers. It was torn between the rulers of Fes and the rulers of Tlemcen, and from the 16th century, it was contested by the Alaouite dynasty.
The French occupied it in 1844 and again in 1859. To the west of the city is the site of the Battle of Isly in 1844. In 1907 and 1908 Oujda was reconquered by General Bugeaud and Marshal Lyautey and used as a French military base to control eastern Morocco. The modern city owes much of its present form to the French, it developed along the roads built at that time.
The 1948 Anti-Jewish Riots in Oujda and Jerada occurred in this city. The crowd, sparked off by a minor incident, poured into the Jewish quarter. In the three hours that passed before the army could control the mob, five people (including one Frenchman) had been killed, 30 had been severely injured, shops and homes had been sacked.
The Moroccan border with Algeria is just east of Oujda; on the other side of the border is the Algerian town of Maghnia. The border has been closed since 1994.
Oujda