The city was founded c. 924 under the name al-Muhammadiya, named after the second Fatimid caliph, al-Qa’im, during the latter’s campaign against the rebellious Berber tribes of central Algeria. Meant to cement Fatimid control over the Hodna plain, the construction of the city was entrusted to Ali ibn Hamdun al-Andalusi, who became its first governor. Much building material for the new city was taken from a nearby ruined Roman city (likely Lambaesis or Timgad).

M’sila was the location of the first village constructed as part of a government-run program to transition nomadic Algerians to sedentary life using local materials. The village, now complete, was dubbed Maader and consists of houses, public and trading areas, and a mosque. Today it is much more developed with many companies, business offices, religious centers and schools.