In March 1568, owing to the fall of Mohammed Basha, the Vice-royalty of Algiers became vacant, and, through the good offices of his old friend Piali, Ali became Governor. He thus returned to occupy a position of literally sovereign power to the city which he had first entered as a galley-slave.
That he was no negligent Governor and that he took an entirely intelligent view of his functions, is proved by an occurrence which took place in this same year in Spain. The Moriscoes in the Kingdom of Granada revolted against their Spanish Governor, by whom they were sorely oppressed. They sent messages to Ali at Algiers, begging for succour against their persecutor. But the Basha would send no expedition; he permitted all and sundry to go as volunteers, but gave out publicly that “it more concerned him to defend well his own State than to interfere in the affairs of others.” He even went farther than this, and when a number of Moriscoes, who were settled at Algiers, embarked a quantity of arms for transportation to the coast of Andalusia, he put an embargo on the vessels and would not allow them to sail, saying “he would never suffer the exportation of what was so necessary for the defence of his own dominions.” At last, after much importunity, he consented “that all such as had two of a sort—as muskets, swords, or other weapons—might, if they thought fit, send over one of them, provided they did it gratis and purely for the cause’ sake; but he would never allow any of them to strip themselves of their arms for lucre.”
Ali, being now firmly established at Algiers, took up arms against the neighbouring State of Tunis. For long years now the King of Tunis had been protected by the Spaniards—a nation whom the Sea-wolves always held in singular abhorrence as the most bigoted of the Christian Powers, and who held in thrall many of their co-religionists. Hamid, son of Hassan, who now ruled in Tunis, had reduced that unfortunate State to anarchy bordering on rebellion, and the whole country, torn by internal feud, was ready to rise against him. The Goletta was in the hands of the Spaniards; Carouan, an inland town, had set up a king of its own, while the maritime towns passed from the domination of the Sea-wolves to that of the Christians, and from the Christians back to the Sea-wolves, according to which party happened to be the stronger for the time being.