Midelt grew in the first half of the 20th century around a French administrative post by the same name. Previously, villages and ksour had dotted the fertile surroundings. The French established their post to facilitate the mining of lead, gypsum, other minerals, and fossils in the nearby Ahouli and Mibladen mines and elsewhere. The development of these mines led to the construction of a railroad from Midelt to the Mediterranean coast and the electrification of Midelt in 1930. In Morocco, only Casablanca received electricity earlier.