After the Reconquista of Spain was complete, large amounts of Muslims fled to Morocco. The number was likely in the hundreds of thousands, if not millions. The Reconquista was the 're-capture' of Spain by King Ferdinand and Queen Isabella, capped off in the take-over of Granada in 1492.
Among those who had shifted to Morocco is the amazing story of a girl named Aisha. She was seven when they had to flee. In Morocco, she married a much older, but well-to-do man, who also happened to be the governor of Tètouan. She was a quick learner, and after her husband's death in 1515, at age thirty, she took his place as the city's leader. Her intelligence and charm soon became so widespread that the King of Morocco himself proposed to her. But the people of Tètouan loved her, and in return, she was loyal to them, so she turned down the offer, as she had no intent to leave her city. So magnetic was Aisha, that the King decided to shift from Fès to Tètouan so that she would accept. And she did.
Atop her agenda as Queen of Morocco was to push back King Ferdinand and retake Andalusia. But how would she start? It would have to be a war of attrition. She would cut off Spanish supply lines by attacking their ships at sea.
In this, she found a great ally. The famed pirate, Barbarossa (Italian for Red Beard). He was Uruj Al-Rayyis, an Albanian who first hit the seas innocently as a pottery salesman, traveling from coast to coast with his father and brothers. In his dealings, he learned Italian, Greek, Spanish, French and Arabic. But on one journey, their ship was captured by the Knights Hospitaller, remnant Crusaders, who were now reduced to being pirates off the coast of Tripoli in Lebanon. Uruj was injured, but his brother was killed, and the experience became his initiation into a life of sea-fighting.
The Ottomans hired him to clear the seas of the remnant Crusader Knights. Driven by the loss of their brother, Uruj and his surviving brother, Ishak, became ship-capturing virtuosos, dominating the Eastern Mediterranean. During the Reconquista, they worked to shift thousands of Muslims and Jews from Spain to Algeria.
In 1516, the Spanish captured Algiers, and it was Uruj and Ishak that repelled the invading force and took the city back, declaring himself Sultan Uruj. It was he who decided that the best defense against the Spaniards was to join the Ottomans. So he wrote to Sultan Selim I, who accepted and made him the Bey (Governor) of Algiers, sending him janissaries, galleys and cannons.
As Bey, Uruj received an official communique from Morocco. The Queen sought an alliance in the fight against the Spanish. He would control the East and she would control the West. He agreed. But she did not just manage from the coast. She actually boarded the ships and took to the seas. Under her leadership, her navy effectively controlled the Western Mediterranean. Whenever the Spanish and Portuguese sought to take back their captives, they had to negotiate the ransom with her, now known by the Muslims as Al-Sayyida al-Hurra.
Alas, Spain was too fortified for a land assault, and her attacks were limited to the seas. When the King died, she became the sole ruler of Morocco. But it did not end well. Her son-in-law rebelled against her, and exiled her. How and where she died remains unknown. But that is the story of Aisha, Al-Sayyida al-Hurra, the girl who became a queen, the queen that became a pirate.