 Complete the following phrase:  After several conflicts with local Barbary pirates sponsored by the Zayyanid sultans, Spain decided to invade Algeria and defeat the native Kingdom of Tlemcen. In 1505 they invaded and captured Mers el Kébir, and in 1509 after a bloody siege, they 