It began with centuries of piracy and enslavement in the Mediterranean sea, leading to the https://en.wikipedia.org/wiki/Barbary_Wars , which in turn led to the https://en.wikipedia.org/wiki/Bombardment_of_Algiers_(1816) . All this doesn't set a path for the invader to offer equal rights to the "indigenous" population.