Such scenes as this were now frequent in Cordova. Each revolution brought its fresh crop of horrors. The people of Cordova, who had greatly increased in numbers, had also nourished those independent sentiments which the immense development of trade and manual industry, and the consequent creation of a prosperous artisan class, generally promote; and when they overturned Almanzor's dynasty, the mob broke out in the usual manner of mobs, and wreaked their vengeance by pillaging the beautiful palace which the great Minister had built in the neighbourhood of the capital for the use of himself and the government officials. When they had ransacked the priceless treasures of the palace, they abandoned it to the flames. Massacres, plundering, and assassination went on unchecked for four days. Cordova became a shambles. Then the Berbers had their turn; the imperious Slav guards, who had won the cordial detestation of the people, were succeeded by the brutal Berbers, who rioted in the plunder of the city. Wherever these barbarians went, slaughter, fire and outrage followed. Palace after palace was ransacked and burnt, and the lovely city of Ez-Zahrā, the delight of the Great Khalif, was captured by treachery, sacked, and set on fire, so that there remained of all the exquisite art that two khalifs had lavished upon its ornament nothing but a heap of blackened stones. Its garrison was put to the sword; its inhabitants fled for refuge to the mosque; but the Berbers had neither scruples nor bowels, and men, women, and children were butchered in the sacred precincts (1010).
While the capital was torn to pieces by savage bands of Slavs and Berbers, and was setting up one khalif after another, varying the family of Omeyya with that of Hammūd, or trying the effect of a governing town council, the provinces had long thrown off all allegiance to the central State. Every city or district had its own independent lord—so soon had the consolidating effects of Almanzor's rule disappeared. The Spaniards themselves enjoyed little of this sudden accession of small powers. They had to look on and lament, while foreigners divided their land among them. Berber generals fattened upon the South; the Slavs subdued the East; "the rest fell to parvenus or to the few noble families who had by some accident survived the blows which Abd-er-Rahmān III. and Almanzor had dealt at the aristocracy. Cordova and Seville, the two most important cities of Andalus, had set up republics,"[25] in name, however, rather than fact; for the Moslem First Consul was a very close likeness of the Emperor. In the first half of the eleventh century some twenty independent dynasties came into power in as many towns or provinces, among which the Abbadites of Seville, the Hammūd family at Malaga and Algeciras, the Zirites at Granada, the Beny Hūd at Zaragoza, the Dhu-n-Nūn dynasty at Toledo, and the rulers of Valencia, Murcia, and Almeria, were the most important. Some of these dynasts were good rulers, most of them were sanguinary tyrants, but (curiously) not the less polished gentlemen, who delighted to do honour to learning and belles lettres, and made their courts the homes of poets and musicians. Mo'temid of Seville, for instance, was a prince of many accomplishments, yet he kept a garden of heads, cut off his enemies' shoulders, which he regarded with great pride and delight. As a whole, however, the country was a prey to disorder as intolerable and as dangerous as that which had prevailed when the Great Khalif came to the throne. It was not quite the same in character; for there was no great Christian rebellion like that of Ibn-Hafsūn; but the anarchy was as universal, and the danger of a total collapse more imminent than ever.
For the Christians of the north were now on the move. They saw their opportunity, and they made the most of it. Alfonso VI., who had united under his sway the three kingdoms of the Asturias, Leon, and Castile, understood his part perfectly. He saw that he only had to allow the various Moslem princes rope enough, and they would proceed to hang themselves with the utmost expedition. These short-sighted tyrants, indeed, caring only for their petty individual power, and eagerly aiding in anything that could weaken their rivals, threw themselves at Alfonso's feet, and implored his assistance whenever they found themselves overmastered by a more powerful neighbour. Partly in consequence of acts of this kind, and partly in terror at the furious raids which the Castilians made throughout the country, even as far as the port of Cadiz, the Moslem States were almost all tributaries of the King of Castile, who took care to annually demand heavier and more heavy tribute, as the price of his friendship, in order to lay up stores for the great conquest which he had in mind. The north was poor, and with a fine irony he trusted to the immense contributions of his vassals among the Andalusian princes to provide the sinews of the war which should destroy them. Divided and jealous as were the Mohammedan dynasts, there was a limit to their patience. When Alfonso had bathed in the ocean by Hercules' Pillars, rejoicing that at last he had traversed all Spain and touched the watery border; when he had established a garrison of more than twelve thousand daring men in the fortress of Aledo, in the very midst of the Moslem territories, whence they ruthlessly emerged to harry the whole country and commit every sort of savage outrage; when Rodrigo Diaz de Bivar, "my Cid the Challenger," had established himself in Valencia with his Castilians, and laid waste the neighbouring lands; when it became clear to everyone that Alfonso meant nothing less than the reconquest of all Spain, and the extermination of all Moslems—then at last the Mohammedan princes awoke to their danger, and began to take measures for their defence. Helpless in themselves and, in spite of the common danger, despairing of any firm collected action among so many and such hostile factions, they took the only other course possible—they called in the aid of the foreigner. Some, indeed, foresaw dangers in such aid; but Mo'temid, the King of Seville, silenced them: "Better be a camel-driver in African deserts," he said, "than a swineherd in Castile!" The power they required was not far off. A new Berber revolution had taken place in North Africa, and a sect of fanatics, called the marabouts or saints (Almoravides, as the Spaniards named them), had conquered the whole country from Algiers to Senegal. They were much the same sort of people as Tārik and his followers, and they were ready enough to cross the water and conquer the fertile provinces of Spain. They made it a favour, indeed, and evinced supreme indifference to the attractions of Andalusia; but they came, and it was easy to see that they meant to stay.
When the Almoravides first came over like a cloud of locusts to devour the country thus offered to their appetite, they found the way perfectly open. The mass of the people of Andalusia rejoiced to see once more a strong arm coming to repress the disorder which had destroyed their well-being ever since the death of the great Almanzor; the petty tyrants either had invited them or could not resist them, and were, at all events, glad to see the Castilians successfully repelled. The Almoravide king, Yūsuf, the son of Teshfīn, after appropriating Algeciras, as a harbour and necessary basis of operations, marched unopposed through the provinces, and met Alfonso at Zallāka, or, as the Spaniards call it, Sacralias, near Badajoz, October 23, 1086. Alfonso, as he looked upon his own splendid army, exclaimed, "With men like these I would fight devils, angels, and ghosts!" Nevertheless he resorted to a ruse to score a surprise over the joint forces of the Berbers and Andalusian; but Yūsuf was not easily disconcerted. He took the Castilian army skilfully in front and rear, and, thus placed between two fires, in spite of the obstinate resistance which the tried warriors of Castile knew well how to offer, he crushed them utterly. Alfonso barely escaped with some five hundred horsemen. Many thousands of the best sword-arms in Castile lay stiff and nerveless on that fatal field.
After the victory, Yūsuf the Almoravide returned to Africa, leaving three thousand of his Berbers to help the Andalusians. He had promised to make no annexations, and, except in retaining the harbour of Algeciras, he had so far kept his word. The Andalusians were delighted with him; they praised his valour and exulted over the saving of the land; they admired his simple piety, which let him do nothing without the advice of his priests, and which had induced him to abolish all taxes in Spain except those few authorized by the Khalif Omar in the earliest days of Islam. The upper classes, indeed, ridiculed his ignorance and rough manners; he could speak but little Arabic, and when the poets recited their charming verses in his honour he generally missed the point of the compliment—no slight offence to the polished and elegant Andalusians, who never forgot their poetry even when they were up to their knees in blood. Yūsuf was to them a mere barbarian. But their contempt for his education did not greatly matter; they could not do without his sword, and the vast mass of the people, thinking rather of comfort than culture, were ready to receive him joyfully as sovereign of Andalusia. In 1090 the King of Seville again prayed the Almoravide to come over and help him against the Christians, who were as bold as ever, and carried on a perpetual guerilla warfare from their stronghold of Aledo. He acceded, with assumed unwillingness, and this time he directed his attacks quite as much against the Andalusian princes as against the Christians of Castile. These foolish tyrants dinned into his ears innumerable complaints against each other, and mutually betrayed themselves to such an extent, that Yūsuf very soon had grounds for distrusting the whole body of them. He had on his side the people, and, above all, the priests. These soon absolved him from his promise not to annex Andalusia, and even went so far as to urge him that it was his duty, in God's name, to restore peace and happiness to the distracted land. Always under the influence of his spiritual advisers, and sufficiently prompted by his own ambition without any such external impetus, Yūsuf readily fell in with this view, and before the year 1090 was out he had begun the subjugation of Spain. He entered Granada in November, and distributed its wonderful treasures—its diamonds, pearls, rubies, and other precious jewels, its splendid ornaments of gold and silver, its crystal cups, and gorgeous carpets, its unheard-of riches of every sort—among his officers, who had never in their lives seen anything approaching such magnificence. Tarīfa fell in December, and the next year saw the capture of Seville and many of the chief cities of Andalusia. An army sent by Alfonso, under the famous captain, Alvar Fañez, was defeated, and all the south lay at the feet of the Almoravides—save only Valencia, which no assault could carry so long as the Cid lived to direct the defence. In 1102, after the hero's death, Valencia succumbed, and now the whole of Mohammedan Spain, with the exception of Toledo, had become a province of the great African empire of the Almoravides.
The mass of the people had reason to be satisfied, for a time, with the result of their appeal to the foreigner. A minority, consisting of all the men of position and of education, were not so well pleased with the experiment. The reign of the Puritans had come, and without a Milton to soften its austerity. The poets and men of letters, who had thriven at the numerous little courts, where the most bloodthirsty despot had always a hearty and appreciative welcome for a man of genius, and would generally cap his verses with impromptu lines, were disgusted with the savage Berbers, who could not understand their refinements, and who, when they sometimes attempted to form themselves upon the model of the cultivated tyrants who had preceded them, made so poor an imitation that it was impossible to help laughing. The free-thinkers and men of broad views saw nothing very encouraging in the accession to power of the fanatical priests who formed the Almoravides' advisers, and who were not only rabidly opposed to anything that savoured of philosophy, but read their Koran exclusively through the spectacles of a single commentator. The Jews and Christians soon discovered what the tolerance of the Almoravides was: they were cruelly persecuted, massacred, or else transported. The old noble families, the few that remained, and the remnants of the petty princes, were in despair when they saw the stranger, whom they had bidden to their aid, taking up his permanent station in their dominions, and recalled with terror the doings of similar hordes of Berbers in the latter days of the Cordovan Khalifate. But the mass of the people were glad enough to see the Almoravides staying in the land; their lives and goods were at last safe, which had never been the case when the country was cut up into a number of separate principalities, few of which were strong enough to protect their subjects outside the castle gates; the roads were free from the brigands who had made travelling impossible for many years, and the Christians, instead of pouncing upon unsuspecting villages and harrying the land, were driven back to their own territory, where a wholesome dread of the Berbers, and a long strife among themselves, kept them at a safe distance. Order and tranquillity reigned for the moment; the law was respected, and the people once more dreamed of wealth and happiness.
The dream was a delusion. There was no prosperity in store for the subjects of the Almoravides. What had happened to the Romans and the Goths now happened to the Berbers. They came to Spain hardy rough warriors, unused to ease or luxuries, delighting in feats of strength and prowess, filled with a fierce but simple zeal for their religion. They had not been long in the enjoyment of the fruits of their victory when all the demoralization which the soft luxuries of Capua brought upon the soldiers of Hannibal came also upon them. They lost their martial habits, their love of deeds of daring, their pleasure in enduring hardships in the brave way of war—they lost all their manliness with inconceivable rapidity. In twenty years there was no Berber army that could be trusted to repel the attacks of the Castilians; in its place was a disorganized crowd of sodden debauchees, miserable poltroons, who had drunk and fooled away their manhood's vigour and become slaves to all the appetites that make men cowards. Instead of preserving order, they had now become the disturbers of order; brigands, when they could pluck up courage to attack a peaceful traveller; thieves on all promising opportunities. The country was worse off than ever it had been, even under the petty tyrants. The enfeebled Berbers were at the beck and call of bad women and ambitious priests, and they would counterorder one day what they had commanded the day before. Such rulers do not rule for long. A great revolution was sapping the power of the Almoravides in Africa, and the Castilians under Alfonso the Battler resumed their raids into Andalusia. In 1125 they harried the south for a whole year. In 1133 they burnt the very suburbs of Cordova, Seville, and Carmona, and sacked Xeres and set it in a blaze. The Christian forays now extended from Leon to the Straits of Gibraltar, yet the besotted government did nothing to meet the danger. Exasperated at its feebleness, the people finally rose in their wrath and drove their impotent rulers from the land.
"At last," says the Arab historian, "when the people of Andalus saw that the empire of the Almoravides was falling to pieces, they waited no longer, but, casting away the mask of dissimulation, broke out into open rebellion. Every petty governor, chief, or man of influence, who could command a few followers and had a castle to retire to in case of need, styled himself Sultan, and assumed the other insignia of royalty; and Andalus had as many kings as there were towns in it. Ibn-Hamdīn rose at Cordova, Ibn-Maymūn at Cadiz, Ibn-Kāsy and Ibn-Wezīr Seddaray held the west, Lamtūny Granada, Ibn-Mardanīsh, Valencia; some Andalusians, others Berbers. All, however, shortly disappeared before the banners of Abd-el-Mumin, who deprived every one of them of their dominions, and subjected the whole of Andalus to his rule." Abd-el-Mumin was the leader of the Almohades, who succeeded to the Almoravide power in Africa and Spain.