The Treaty of Algeciras of 1906, which formalized French preeminence in Morocco and precipitated the establishment of a French protectorate in Morocco, accorded a contract to construct modern ports in Casablanca and Asfi to "Compagnie Marocaine". In fact, it was an attack on the company's Decauville train that incited the Bombardment of Casablanca in August of 1907, marking the beginning of the French conquest of Morocco.