structural:scholar_edition, linguistic:paraphrasing, information:highlighting, quality:correction
Reforms under Almanzor

The death of Al-Hakam II in 976 marked the beginning of the end of Caliphal power. Al-Hakam wa succeeded by his only son, Hisham II. Al-Hakam's top advisor, Almanzor, pronounced the 10-year-old boy caliph and swore an swore an oath of obedience to him.

Almanzor had great influence over Subh, the mother and regent of Hisham II. Almanzor isolated Hisham in Córdoba, eradicated opposition, and allowed Berbers from Africa to migrate to al-Andalus to increase his base of support. While Hisham II was caliph, he was merely a figurehead.

In 996, Almanzor sent an invasion force to Morocco. After three months of struggle, his forces retreated to Tangier. Almanzor then sent out a powerful reinforcement under his son Abd al-Malik, whose armies clashed near Tangier. The Umayyads entered Fes on 13 October 998 once the gates of the city were opened.

Almanzor continued the military reforms by Al-Hakam and his predecessors. He professionalized the regular army, which guaranteed his military power in the capital and ensured the availability of forces for numerous campaigns. Professionalization de-emphasized levies and other non-professional troops, which were replaced with taxes to support the professional troops – often saqaliba or Maghrebis – and freed Córdoban subjects from military service. Almanzor expanded recruitment of the saqaliba and Berbers. He also created new units, outside the regular army of the Caliphate, that were loyal to him and served to control the capital.

Almanzor abolished the system of tribal units with their own commanders. This system had been in decline due to a lack of Arab recruits and the pseudo-feudalistic institutions on the frontiers. A new system of mixed units without clear loyalty under orders from Administration officials replaced it.

The increase in military forces and their partial professionalization led to an increase in financial expenses, and incentivized campaigning so troops could be paid with loot and land. Lands handed over to the soldiers were subject to tribute and ceased to operate under a system of border colonization.

The nucleus of the new army was formed by Maghrebi Berber forces. Arabs, Berbers, and Slavs within the army were played off against one another by Almanzor to maintain his power.

The massive incorporation of North African horsemen relegated the infantry to sieges and fortress garrisons. This reform led to entire tribes, particularly Berber riders, being moved to the peninsula.

At that time al-Andalus was known as Dar Jihad, or "country of jihad". It attracted many zealous volunteers, who made up a small but important portion of the total army. Almanzor's personal guard was made up of Christian mercenaries who also participated in his campaigns in Christian territories.

Contemporary figures on the size of the army are contradictory. Some accounts claim that their armies numbered two hundred thousand horsemen and six hundred thousand foot soldiers, while others talk about twelve thousand horsemen, three thousand mounted Berbers and two thousand sūdān, African light infantry. Christian chroniclers record that "ordinarily the Saracen armies amount to 30, 40, 50 or 60,000 men, even when in serious occasions they reach 100, 160, 300 and even 600,000 fighters" in the time of Almanzor. In the campaign that swept Astorga and León, chroniclers record Almanzor leading 12,000 African horsemen, five thousand al-Andalusi horsemen, and 40,000 infantry. Stories of Almanzor's last campaign record forty-six thousand horsemen, six hundred forces guarding the train, 26,000 infantry, two hundred scouts or 'police', and one hundred and thirty drummers. The garrison of Córdoba was recorded at 10,500 horsemen, while other forces kept the northern border in dispersed detachments.

Other modern studies found the army was between 50,000 and 90,000 under Almanzor. Scholars have argued Almanzor's armies could muster 600,000 laborers and 200,000 horses "drawn from all provinces of the empire". Évariste Lévi-Provençal argues the Almanzor's armies were between 35,000 and 70–75,000 soldiers. It is likely that the leader's armies may not have exceeded twenty thousand men. Until the eleventh century no Muslim army on campaign exceeded thirty thousand troops, while during the eighth century the trans-Pyrenean expeditions totaled ten thousand men and those carried out against Christians in the north of the peninsula were even smaller.

The main weapon of the peninsular campaigns, which required speed and surprise, was the light cavalry. To try to counteract them, the Castilians created the role of "villain knights" by ennobling those free men who were willing to keep a horse to increase the mounted units through the Fuero de Castrojeriz of 974. For similar reasons, the Barcelonan count Borrell II created the figure of the homes of paratge who obtained privileged military status by fighting against the Córdobans armed on horseback – after losing their capital in the fall of 985.

Military industry flourished in factories around Córdoba. The city was said to produce 1,000 bows and 20,000 arrows monthly, and 1,300 shields and 3,000 campaign stores annually.

In contrast to the role the navy played under Abd al-Rahman III, under Almanzor, it served as a means of transporting ground troops, such as between the Maghreb and the Iberian Peninsula. This was also seen with Alcácer do Sal 's ships in the campaign against Santiago de Compostela in 997. As in the army Almanzor recruited Berbers faithful to him. In its administration he favored the saqalibas to the detriment of native officials. The fleet was reinforced with a network of ports and a new base in the Atlantic, in Alcácer do Sal, which protected the city of Coimbra, recovered in the 980s. It served as start of a campaign against Santiago. On the Mediterranean shore, the naval defense was centered at the base of al-Mariya, now Almería. The dockyards of the fleet had been built in Tortosa in 944. The fleet also maintained a significant budget.

Initially, the maritime defense of the Caliphate was led by Abd al-Rahman ibn Muhammad ibn Rumahis, a veteran admiral who had served Al-Hakam II and was Qadi of Elvira and Pechina. He repulsed raids by al-Magus (idolaters) or al-Urdumaniyun ('men of the north', Vikings), in the west of al-Andalus in mid-971. When there was another invasion later that year, the admiral left Almería and defeated them off the coast of Algarve. In April 973, he transported the army of Ghalib from Algeciras to subdue the rebellious tribes of the Maghreb and end Fatimid ambitions in that area.

In 985, the fleet ravaged the Catalans. During the Catalan campaign, Gausfred I, Count of Empurias and Roussillon tried to raise an army to help but several flotillas of Berber pirates threatened their coasts, forcing them to stay to defend their lands. In 997 the al-Andalusi fleet hit the Galician coast.

Almanzor eliminated figures who could have opposed his reforms, such as killing Ghalib. Almanzor also replaced the governor of Zaragoza after he collaborated with his eldest son to replace him with a member of the same clan, the Banu Tujib. The admiral of the fleet was also poisoned in January 980 and replaced.

Land transport routes were dotted with strongholds, and dignitaries controlled communications. Messengers were bought in and specially trained to handle Almanzor's messages and to transmit the official reports that his foreign ministries wrote about the annual campaigns.