Siege of Valencia (1099)

The siege of Valencia occurred in 1099 when Ibn Yusuf's vast Moorish armada landed on the eastern shore of Spain and laid siege to the recently-captured city of Valencia, defended by Castile's vassal El Cid. The Moors had a formidable and large army, but the brave Valencians and the reinforcements of King Alfonso VI of Castile succeeded in repelling the Muslim invasion, with the Moors being frightened when the dead El Cid was sent out on his horse Babieca, believing that he was a ghost. Valencia was a great victory against the Moors, but it would fall in 1103.

Background
The North African Almoravid emir Ibn Yusuf had been preparing for a massive invasion of Spain for years, gathering several emirs and asking for them to stop their progressive Muslim rulership styles (such as allowing for science, music, and art to flourish) and start focusing on war. He assembled a Moorish armada from all parts of North Africa, and he had help from some emirs in Spain, such as the Emir of Valencia, al-Kadir, who agreed to hold off any besiegers until the armada could land. However, Ibn Yusuf's plans were complicated when Rodrigo Diaz de Vivar (better known by his Arabic nickname, "El Cid") seized the city in May 1094 at the head of an army of both Christians from Castile and Moors that feared Ibn Yusuf's takeover of al-Andalus. In sending King Alfonso VI of Castile the crown of Valencia, El Cid confirmed his allegiance to Castile, and he succeeded in gaining King Alfonso's support when the large Muslim army landed and laid siege to the city.

Initial battle
El Cid's second-in-command Yusuf al-Mu'taman ibn Hud advised El Cid to attack the Moorish army before it could fully disembark from its fleet. El Cid decided to lead the army out of the walls to fight, and the knights of both armies charged into battle before the infantry charged in for melee. The ensuing battle was very bloody, with the armies having at each other in murderous melee. Castilian archers repulsed Moorish cavalry that attempted to charge them, and El Cid and his allied commanders personally fought in the slaughter. El Cid was wounded when archers aboard the Moorish ships fired volleys at the Castilians, and El Cid was struck by an arrow in the chest. His men's morale collapsed as they saw a wounded El Cid return to the castle, and the whole army retreated.

Interlude
El Cid rode back into the castle, informing Count Ordonez that he had to attack the Moors the next day, or else the Moorish army would grow stronger and harder to beat. al-Mu'tamin informed him that he would die within days if he did not have the arrow removed from his chest, but El Cid convinced his wife Ximena to allow him to die in a few days, as long as he could fight the next day and allow for Ximena to inherit Valencia. The Moors rejoiced upon hearing of El Cid's "death", with Ibn Yusuf spreading the word that El Cid had died. El Cid's own army believed him to be dead, and they did not believe his nephew Alvar Fanez when he informed them that he was still alive. However, El Cid managed to stand on a balcony above the city, telling his people that he would lead them into battle the next day, and his men cheered him on.

El Cid returned to his bedchambers, slowly passing away, and he made Ximena promise that he would ride into battle (either dead or alive) atop his horse Babieca. She agreed to this reluctantly. Later, King Alfonso himself arrived to help El Cid, regretting his past mistreatment of him. El Cid told Alfonso to not kneel down by his bedside, saying that his king should kneel for nobody; he also told him that it was uncommon for a king to conquer himself, and he congratulated the king for his transition to being a real ruler. El Cid told the king that he would ride alongside him into battle, and he asked Ximena to have her and their children remember the day that he and his king fought side by side in battle.

The final battle
At the dawn of the next day, El Cid's body was mounted upon his horse, dressed in battle armor, and he was strapped to Babieca as he rode out of the castle with King Alfonso VI and al-Mu'tamin on either side of him. The Moors were scared at the sight of El Cid, believing that his ghost had come back from the dead. As El Cid approached, the Moors began to flee, and Ibn Yusuf attempted to rally his men against El Cid. However, Ibn Yusuf was knocked from his horse by El Cid's shield, and other horsemen trampled him as they charged the fleeing Muslims. Catapults from the city also rained flaming rocks upon the fleeing Moors, ensuring that they did not return. Valencia was safe, and the large Moorish army was no more.

Aftermath
El Cid became a legend after his death, and King Alfonso VI led a prayer for him after the battle, calling him "the purest of knights". Ximena became the lady of Valencia, ruling the city as a vassal of King Alfonso. In 1103, a large Moorish army returned to besiege the city, and Ximena decided to burn Valencia to the ground rather than see it fall to the Moors. She retired to a convent, where she died some years later.