Incited by the prospect of absolute success, Muza collected in the following year a well-equipped army of 12,000 men, to the command of which Tarik was appointed. Embarking on board a large flotilla, he once more crossed the Strait, and, this time, landed on the sandy isthmus which connects the Rock with the Spanish mainland. Before entering on the conquest of the country, he deemed it advisable to secure his communication with Africa, by establishing a strong military position on the coast; and his keen eye having at once detected the value of the Rock, he ordered a castle to be raised upon it. Some portions of this ancient structure still remain; and an inscription discovered over the principal gate, before it was demolished, recorded the completion of the work in 725.

“Thou, Calpe, saw’st their coming; ancient rock
Renowned, no longer now shalt thou be called
From gods and heroes of the years of yore,
Kronos, or hundred-handed Briareus,
Bacchus or Hercules; but doomed to bear
The name of thy new conqueror, and thenceforth
To stand his everlasting monument.
Thou saw’st the dark-blue waters flash before
Their ominous way, and whiten round their keels;
Their swarthy myriads darkening o’er thy sands.
There on the beach the Misbelievers spread
Their banners, flaunting to the sun and breeze;
Fair shone the sun upon their proud array,
White turbans, glittering armour, shields engrailed
With gold, and scymitars of Syrian steel;
And gently did the breezes, as in sport,
Curl their long flags outrolling, and display
The blazoned scrolls of blasphemy. Too soon
The gales of Spain from that unhappy land
Wafted, as from an open charnel-house,
The taint of death; and that bright sun, from fields
Of slaughter, with the morning dew drew up
Corruption through the infected atmosphere.”

Leaving a small force at the foot of Jebel-Tarik, as the Saracens named the Rock, in honour of their leader, Tarik pushed forward to the westward, captured Carteia, and encountered the Goths, under King Roderick, near Xeres in Andalusia. The battle was fiercely contested. The Goths fought with all their old valour, and victory might have rested with King Roderick, had not some of his nobles, with their followers, deserted him at the crisis of the fight, and joined the invaders. The Goths then gave way, and the Moors pressing them closely, their retreat soon became a headlong flight.

“Eight summer days, from morn till latest eve,
The fatal fight endured, till perfidy
Prevailing to their overthrow, they sank
Defeated, not dishonoured. On the banks
Of Chrysus, Roderick’s royal car[4] was found,
His battle-horse Orelio, and that helm
Whose horns, amid the thickest of the fray,
Eminent, had marked his presence. Did the stream
Receive him with the undistinguished dead,
Christian and Moor, who clogged its course that day?
So thought the conqueror, and from that day forth,
Memorial of his perfect victory,
He bade the river bear the name of Joy.”[5]

Flushed with victory, Tarik advanced into the country, and meeting with no organized attempt at opposition, rapidly made himself master of the provinces of Asturias, Biscay, and of the interior of Spain. The Goths, driven into the mountains, gradually settled down into little communities, which after a while were attracted towards one another by the common sentiment of patriotism and hostility towards the infidels. Then they descended from their mountain-recesses, and after a protracted series of contests succeeded in expelling the Moors from the northern provinces. Encouraged by this success, the chiefs allied themselves together for the purpose of driving them wholly out of Spain; and this being accomplished, they founded the several independent kingdoms of Leon, Galicia, Asturias, Navarre, and Castile.

Meantime, Gibraltar had increased in importance, though at that time it was surpassed by the neighbouring town of Algesiras. Early in the fourteenth century, however, Ferdinand, King of Castile, wrested it from its Moorish garrison, and it remained in the hands of the Spaniards until 1333. Then Abomelique, son of the Sultan of Fez, having landed on the coast with a force to assist the Moorish king of Granada, immediately attacked the fortress of the Rock, and captured it after a brave resistance. The Spanish troops fought with determined resolution, and surrendered at the approach of famine rather than to the summons of the enemy.

Alonzo XI., King of Castile, was hastening to the relief of the beleaguered stronghold, when news of its capitulation reached him. He resolved to attempt its recapture before the Moors could throw in provisions or repair and strengthen its defences. Pressing forward with great rapidity, he arrived before Gibraltar on the fifth day after its surrender. Dividing his army into three sections, he posted the main body on the isthmus, a second on the Red Sands, while the third occupied the north side of the Rock above the town. He made several desperate efforts to storm the castle, but each time was repulsed with severe loss; and eventually found himself in the position of the besieger besieged—the king of Granada uniting his forces with those of Abomelique, and encamping in the rear of the Spaniards so as to raise a formidable barrier across the isthmus from the Bay to the Mediterranean, and cut off their supplies of provisions. For a few days longer Alonzo desperately pressed his attacks; but at length was compelled by famine to open up negotiations with the Moorish chiefs, which resulted in his being allowed to retire with his troops, unmolested. Soon afterwards the Christians surprised the Moorish camp, and Abomelique was slain. His father avenged his death by falling upon the Spanish fleet, which he completely destroyed; but Alonzo was still bent on the recovery of Gibraltar, and in 1349 collected a powerful army for this purpose. His task was more difficult than on the previous occasion, the Moors having greatly added to the strength of the fortifications, and garrisoned it with their best troops.

It was in the spring of the year that Alonzo sat down before Gibraltar, and he conducted the siege with great vigour, harassing the garrison with constant attacks and incessant storms of missiles, and intercepting their communications by land and sea. He was on the point of success when the plague broke out in his camp, sweeping away thousands of his soldiers, and carrying off himself on the 26th of March 1350. The siege was immediately raised, and the Crescent still shone luridly from the battlements of the fortress-crowned Rock. But dissensions breaking out among the Moors themselves, the castle was seized, in 1410, by Jusef III., King of Granada. His rule, however, proved so distasteful to the inhabitants that they rose against him, compelled his garrison to retire, and then implored the Emperor of Morocco to take them under his protection. The emperor despatched his brother Said to their assistance with 1000 horse and 2000 foot; but the King of Granada was unwilling to surrender his prize, and assembled a fleet and army which speedily compelled the unfortunate Said to capitulate.

After an interval of a quarter of a century, the hopes of the Spaniards once more turned towards the famous Rock, which had been the object of so many vicissitudes. In 1435 Henry de Guzman, Count de Niebla, resolved to invest it by land and sea; but having disembarked from his galleys, and attacked the Moors, before his son John had brought up the land-forces, he was driven back pell-mell into the sea, and with many of his followers perished. In 1462, John de Guzman had the satisfaction of avenging his father’s death. A civil war had broken out in Moorish Granada, and a considerable portion of the Gibraltar garrison had been withdrawn to strengthen the army of one of the aspirants to the crown. The governor of Tarifa, apprised of the opportunity thus offered, rapidly collected a body of Spanish troops and appeared before Gibraltar. The inhabitants defended it bravely; but John de Guzman arriving with reinforcements for the besieging army, they surrendered, and the Cross supplanted the Crescent after a period of seven hundred and forty-eight years. This event was so grateful to Henry IV., King of Castile and Leon, that he added Gibraltar to his royal titles, and bestowed upon the fortress the armorial bearings of a castle, gules, proper, with a key pendent to the gate, or,—thereby indicating that Gibraltar was the key to the Mediterranean. Don Pedro de Perras was appointed governor; but the post was afterwards given to Don John de Guzman, who seems to have held it as a semi-independent fief until 1502, when, in the reign of Ferdinand and Isabella, it was reclaimed by the Crown.

In 1589 its fortifications were extended and modernized by the imperial engineer, Daniel Speckel: from which date it was regarded as impregnable, until Sir George Rooke dispelled the long-cherished delusion.