In 1509, Spain conquered Oran from the Algerian Kingdom of Tlemcen. The Spanish garrison had to engage in a form of diplomacy with the local Algerian tribes, as to not get raided by them.