The bombardment came after an attack of tribesmen of the Shawiya opposed to the terms of the Treaty of Algeciras of 1906 to the French presence in the customs house and to the construction of a railroad over a sanctuary, specifically on European employees of the Compagnie Marocaine operating a Decauville train from a quarry in Roches Noires to the Port of Casablanca on July 30, 1907.
On July 29, a delegation of Chaouia tribes presented itself to Moulay Lamine, the governor of the province and uncle of Morocco's young sultan, Abdelaziz El-Alawi, with the desire to demolish the works under way.
Another delegation met with the city's pasha, Si Boubker Ben Bouzid Slaoui to protest and demand an end to the construction on the port, the destruction of the railroad and the removal of the French supervisors at the customs house.
People of the Chaouia took to the streets and violence broke out that afternoon, which led leading to the death of nine European labourers working for the Compagnie Marocaine, the French company that was chosen to build the port.
The morning of August 5, 66 men disembarked from Galilée to protect the French consulate, a move that was criticised by other European powers present in Casablanca, as it aggravated the situation in the city.
The working-class neighborhood Tnaker (تناكر), near the port, paid the heftiest price by taking shrapnel from shells filled with mélinite, a nitric compound that was adopted by the French government.
The squadron of Rear-Admiral Joseph-Alphonse Philibert brought General Antoine Drude's troops, including French and Algerian tirailleurs, to shore at the beach of Sidi Belyout, where they were met with Moroccan fire.
Over three days of bombs raining down from the French warships, followed by carnage and pillaging from troops on the ground, what had been a prosperous city of 30,000 inhabitants was transformed into a field of rubble with nothing spared except for the European neighbourhood.