The People of Gibraltar
1067 - The Moorish Castle - Edificio  de  Hércules

Mr. Benedic 

Gibraltar's Tower of Homage may not be the most elegant Moorish Castle in Iberia but it is probably the largest. In fact it is so big and imposing that one would have imagined it would be easy to trace its origins and find out exactly who was responsible for having built the thing. Nothing could be further from the truth. At the time of writing and despite much research into obscure Arabic documents and tentative archaeological investigations we still really haven't a clue.

The Moorish Castle  ( Late 19th century )

The following therefore covers my own very limited research into this conundrum. It is based entirely on whatever documents I have been able to uncover. But to start at the probable beginning. 

Tarik ibn Zayed put Gibraltar on the map in 711 (see LINK) but unfortunately he never stayed very long. He had come to conquer the whole of Iberia and he seems to have quickly come to the conclusion that Gibraltar itself was hardly worth the trouble. Some have argued that he never even landed on the Rock itself all of which make it very unlikely that he had anything to do with the construction of any precursor to Gibraltar's Tower of Homage. Perhaps one can blame either the 13th century Egyptian writer Ibn al-Athir for what is almost certainly an old misconception. 
. . . después de entrar in las llanuras, conquistó Algeciras y otros sitios, y abandonó el fuerte (hisn) que estaba en las alturas del monte . . .
 . . or the following from the Dikr Bilad al-Andalus an anonymous account written in the 14th century:
Según  otro  relato,  cuando Tariq   y  los  ejércitos  musulmanes atravesaron  el  mar,  desembarcaron  a  los  pies  de  Gibraltar,  que  es  la Montaña de la Conquista; desde allí ascendió hasta la cumbre y ordenó construir  una  inexpugnable  fortaleza  en  la  que  se  encastilló  con  los musulmanes.
If he did in fact order the building of anything it was probably just an atalaya or look-out post - certainly nothing as grand as a hisn or an impregnable fortress. He simply didn't have either the time or the resources to do this.  

Three hundred years later Algeciras was ruled by the Hammudies and it has been claimed that during this period - from 1025 to 1055 - Gibraltar must by now have possessed a proper Castle. The evidence is very indirect and very circumstantial. It is based on the idea that three hundred years is a hell of a long time for a place as imposing as Gibraltar to be completely ignored by the rulers of Algeciras who not only had full control over it but could hardly avoid seeing it in front of them every day. It is hard to believe that the place remained uninhabited and unfortified for so long. There is also the curious fact that in 1067 Al-Mutadid, the King of Seville actually ordered his governor in Algeciras to improve Gibraltar's fortifications. Not build, improve.
Escribe en seguida al gobernador de Algeciras; mándale que fortifique todavía mas a Gibraltar; dile que esté alerta y que espié con mayor atención lo que pasa mas allá del Estrecho. . .
It is an order from which one can conclude that the place was already fortified - although of course it does not necessarily infer the existence of any castle.

The Rock from across the bay and close to Algeciras - they could hardly miss the place   ( Late 19th century - Jean Laurent )   (See LINK

In 1081 Al-Mutadid sent several negotiators from Algeciras across the Straits to try to make a deal with the Almoravid sultan Yusuf Ibn Tasfin. They wanted to offer him Gibraltar in exchange for military help against Alfonso VI of Castile. Yusuf refused and asked for Algeciras. In 1085 Al-Mutadid himself conferred with Yusuf and agreed to hand over Algeciras. There is no mention of Gibraltar but Algeciras was lost and Gibraltar almost certainly with it. If there was a Castle it was now the property of Yusuf and his Almoravids.

The point however is this. Would al-Mutadid have dared to offer the great Moroccan Sultan a completely unfortified and therefore useless Rock? Perhaps - or perhaps not. In any case here is still no mention of anything remotely like a castle.

Then after a hiatus of yet another century, the power structure in Africa changed dramatically and the Almohads took over from the Almoravids. Almost immediately the new supreme Caliph Abd-al Mu'min decided - rather capriciously - to build himself a city on the Rock of Gibraltar. No more Jabal Tarik - it would be Jabal-Fath or the Mountain of Victory from now on - and whatever the town itself had been known as previously - if there had ever been such a thing as town before he arrived - it would now be called Madinat-al-Fath. (See LINK

Interestingly as late as the 14th century the place was still being referred to as the Mountain of Victory rather than Jabal-Tarik - as confirmed  in a passage taken from the Dikr quoted at the beginning of this article. Even during the 17th the Arab writer Al Makkarí  referred to it as Jabal al Fatah. (See LINK)

As regards Abd-al Mu'min there is considerable evidence that he was not the kind of man who did things by halves and he certainly does not seem to have gone half way as regards Gibraltar. The Spanish Historian Leopoldo Torres Balbás using several Moorish sources gives a summary of what the place looked like when it was finished. 
Entre las construcciones levantadas entonces, y que fueron las primeras de los Almohades en al-Andalus, cítance la mezquita mayor, un palacio para alojamiento del soberano, otras destinadas a sus hijos, y residencias para los principales dignatarios de la corte . . . .  todo ello circundado por una muralla de hermosa construcción  . . . 
It would be easy to quote a dozen similar sources praising the wonders of Madinat-al-fath (see LINK) but - rather surprisingly - I can find no sources that specifically mention the Castle. Other descriptive words such as 'calhorra', alcazaba, or 'Torre de Homenaje' are also noticeable for their absence. Perhaps the closest is Al Makkari, writing in the 1620s about the the events that took place in 1160:
Abd-al Mu'min marched to Ceuta, where he embarked for Andalus. He landed at Jabal-Tairik which from that day was called Jebalu-l-fatah (the mountain of the entrance or victory), and ordered that a strong fortress should be erected on the top of it. He traced out the building with his own hands . . . 
The question is - was Abd-al Mu'min's 'strong fortress' a castle - a precursor perhaps of our very own Tower of Homage? The Spanish historian, Sáez Rodríguez suggests that he never built a castle as such but simply a reinforced tower on the north eastern corner of the defensive walls that surrounded Medinat-al-Fath.
La dificultad de llevar el recinto murado hasta la cresta de la montaña y de avanzarla hasta el tajo norte dejaba la nueva ciudad dominada por diversos padrastros desde por lo que podía ser amenazada. . . para contrarrestar a ese problema se reforzaron las defensas del ángulo nordeste  de la fortaleza, en un proceso que condujo a la conversión de su torre esquinera en la enorme Calahorra de la Alcazaba.   

The Moorish Castle as a ruin   (1830s - William Mein Smith )    (See LINK

According to the British historian George Hills the loss of Tarifa to Sancho IV of Castile in 1292 made it necessary for; 
. . .  the maintenance of a stronghold  . . on Gibraltar  . . so as to command a better view of any approach of an enemy fleet from the Tarifa direction, and flash the news to Estepona and Malaga. A stronghold, a walled town at least on Gibraltar, had suddenly become necessary for the first time in the history of Islamic Spain.
If Hills is correct and a fortified town was created around this time then there would be a possibility that this is when the present Castle was built. However, as far as I can make out this is pure speculation - there is no hard and fast evidence of any kind to support Hill's hypothesis.

In 1294 the Marinids sold Algeciras and Gibraltar to the Nasrids of the Kingdom of Granada, but there is no mention of any fortifications -  much less a Castle. 

In 1309 Ferdinand IV of Castile with a little help from Alonso Pérez de Guzmán  'El Bueno'  took Gibraltar after the first of Gibraltar's very many Sieges. (See LINK) Once again there is indirect evidence that a Castle was already in place. According to the author of the Crónica  del Rey Don Fernando IV -
. . . é pusieron dos engeños é combatiéronla muy fuerte á la redonda en ellos, en guisa que lo non pudieron sofrir los moros: 
This is almost certainly a reference to a separate tower built to the east of our still hypothetical Tower of Homage. It was known confusingly as la Torre de Don Alonso (see LINK) the building of which has been attributed to both Alonso de Guzmán and Alonso XI of Castile during the first and fourth sieges of Gibraltar respectively. 

Map showing la Torre de Don Alonso peering over the castle ( Early 17th century  - Unknown )  (See LINK)

However, the Crónica  del Rey Don Fernando IV insists that the King also ordered the following - which rather contradicts the first quote.
. . . mandó labrar los muros de la villa que derrivarón los engeños. É otrosi mandó labrar una torre encima del recuesto de la villa. 
It is quite clear that Ferdinand ordered the construction of some sort of tower. The problem is that ordering it and actually having it constructed are two different things - besides the present tower is Moorish in design not Spanish.

By 1333 less than a quarter of a century later the Rock was back in Moorish hands specifically those of Abu Al'Hasan 'Ali ibn 'Othman who I will refer to from now on as Abu-l-hasan. (See LINK

Immediately following this came the fourth siege in which Alfonso XI of Castile unsuccessfully tried to get it back. It is during this siege that the Tower of Homage is clearly identified - putting it out of action was one of the main objectives for the Spaniards.  According to the Crónicas de Don Alonso XI:
El Rey facia mucho por recobrar este lugar . . . e aquellos que le avian a voluntad de le servir, acudieron de tirar con los engeñios, señaladamente a la torre de omenaje, de manera que la tenían todo desmochada, que no avia de ella ninguna almena nin antepecho tras que podían estar los Moros para la defender.

The Tower of Homage as a romantic ruin   ( 1833 - David Roberts )  (See LINK)

The Chronicles of Alonso XI, however, were written in 1551 which means that there might be an element of hindsight or guesswork involved. It is impossible to tell but it seems highly unlikely that the castle standing today was the same one being written about in either of these Spanish histories - particularly as Abu-l-Hasan is the favourite choice among most historians as the person responsible for building it. To quote Ibn Battuta who visited Gibraltar in 1349/50:
He sent his son, the noble prince Abu Malik, to besiege it, aiding him with large sums of money and powerful armies . . . It was taken after a six month's siege in the year 733 ( 1333 A.D. ) At that time it was not in its present state. Our late master, Abu'l Hassan built in it the huge keep at the top of the fortress, before that it was a small tower, which was laid in ruins by the stones from the catapults 13 and he built a new one in its place . . .
 . .  all of which seems to confirm the theory that Abu l-hasan's had his new structure built over the ruins of the much smaller tower built by Abd-l mu'min's on the north eastern section of the walls of Madinat-al-Fath. Nevertheless there are, in my opinion, a series of inconvenient questions that need answering. 

According to local historians Darren Fa and Clive Finlayson, impact craters on the east face of the present tower probably date from 1333 when Alfonso XI was bombarding the building with siege machines - possibly from the previously mentioned 'Torre de Don Alonso'.

If this is true then in my opinion the creator of the present Tower of Homage cannot be Abu l-Hasan despite the evidence of Ibn Battuta. According to Pedro Lopez de Ayala writing in the mid 14th century in his Cronicas de los Reyes de Castilla:
 . . . el noble Principe Rey Don Alfonso fizo , cercó la villa é castillo de Gibraltar en el año del Señor de mil é trecientos é quarenta é nueve , quando andaba la Era de Cesar . . . E este logar de Gibraltar es una villa é castillo muy noble é muy fuerte, é muy notable é muy preciada entre los Christianos é Moros . . .  
In other words Gibraltar was now a well know place and its castle worthy of comment. 

The Castle  ( 1860s - Carl Goebel )   (See LINK)

Kevin Lane and others in a paper which takes into account new archaeological work as well as a new interpretation of inscriptions once found on the gates of the Castles outer walls suggest that;
 . . . This new translation effectively ascribes the gate to Muhammad V. This makes perfect  historical  sense,  given  that  this  emir  received  Gibraltar  back  from  the  Marīnids  in  1374  and  that  he  also  destroyed  the  fortifications of Algeciras, thereby re-fortifying Gibraltar as the only defended Muslim outpost on the bay.
The conclusion is that both the town and the Castle were built during the late 14th century. Nevertheless after 1350 the Castle is hardly mentioned in the literature until the mid 15th century when it is back in the news again in 1462 when the Spaniards finally capture Gibraltar from the Moors. 

In 1540, Pedro Barrantes Maldonado describes the Castle in his well known Dialogo
Esta  Barcina es cercada  á  la  redonda de una fuerte muralla  bien  espesa  de  torres;  bate  la mar  en  ella  por  la  una  parte,  y  dentro está  la  población  que  antiguamente solía haber  cuando  era  de  moros, y en  ésta  no entraron los turcos.  
Encima  de  esta  parte  cercada,  en  un alto de la sierra,  está  el  castillo,  cercado por sí de  fuertes  muros  y torres  de  piedra; cosa  fuerte  por  la  aspereza  y  sitio donde está asentado.   
Encima  deste  castillo (aunque  se  manda  por  dentro  del)  está  otra fortaleza  que  llaman  la  Carrahola,  que  es una  torre  muy  grande  e  muy  antigua, toda  de  ladrillo  y  cal,  la  cual  dicen  haber  sido edificio  de  Hércules;  esta  es  la principal  fuerza  de  Gibraltar  porque  la pueden  defender  veinte  soldados,  aunque esté ganada  la  ciudad  y el  castillo, el  cual ha menester doscientos  hombres  para  lo defender: en  esta Carrahola están agora los huesos de  don  Enrique,  conde de Niebla, el que  murió  sobre  Gibraltar.

The Moorish Castle - At the top of the three tier structure is the Calahorra- incorrectly identified by Maldonado as the Carrahola    (Possibly copied from a 14th century manuscript - Unknown )

In 1567 it crops up in a sketch by the Flemish draughtsman Anton Van Den Wyngaerde in which we learn that a chapel had been constructed inside the tower of Homage which contained a coffin in which the remains of the Don Enrique de Guzman, the second Conde de Niebla  were laid to rest. Don Enrique, was drowned during his failed attempt to take Gibraltar from the Moors in 1433. (See LINK

The text reads as follows - La sepulcra donde estan Los ossos Dol Condo de neblos coberto do Brocado. Presumably this gold covering was ordered to be placed there by Don Juan de Guzman. Portillo, in fact, was of the opinion that the remains belonged to Don Juan himself   ( 1567 - Anton Van Den Wyngaerde )    (See LINK

A few years later the Spanish engineer Cristobal Rojas - left us a plan of the town which includes the Castle. 

The Castle and town    (1608 -  - Cristobal Rojas  )   (See LINK)

In 1620s the Spanish Engineer Luis Bravo de Acuña was asked by the Spanish Authorities to have a look at Gibraltar's now old fashioned and crumbling defences. Among other things he recommended that the Tower of Homage should be demolished. He argued that it gave the inhabitants a false sense of security. 

The Moorish Castle ( 1627-  Luis Bravo de Acuña - detail )     (See LINK)

Luckily the tower was never knocked down which allowed the man who wrote Gibraltar's first general history - Alonso Hernández del Portillo (see LINK) - to give us a very full description of what the place looked like in the early 17th century:
Tiene un castillo que para el tiempo antiguo, cuando se peleaba sin artillería era fortísimo, y tanto que habiendo venido el Señor Rey Alonso onceno sobre el dos veces, y el Conde de la Niebla otra vez con poder Real jamás ganaron por fuerza los Cristianos, ni los moros, ni cuando lo perdió Basco Perez de Neyra tampoco se lo ganaron por fuerza, sino que él lo entregó por hambre como todo consta por nuestras historias Españolas. . . .  
Tiene este castillo dentro de si una torre que llaman la Calahorra, nombre a mi parecer Árabe; y ha sido tradición, como lo nota Garibay, ser fabrica de Hércules. Tiene por delante un reducto que llaman La Giralda, de fortísima muralla, y capaz de recibir gente bastante para defender la fuerza como vio el año 1333 cuando estubo sobre ella el Rey Don Alonso sin aprovecharle una torre que le fabrico encima que con su nombre dura hoy parte de ella. 
En lo último e interior de esta Giralda que a mi parecer es citadela como de los italianos está la torre Calahorra, como se ha dicho; tiene hornos, un aljibe de agua muy grande y muy hondo, salas y plazas de armas y otros aposentos. La fabrica de la torre y su forma es maravillosa, y digna de ver dedicada a Hércules, y de ser considerada a vista, como lo es, de cualquier persona curiosa que viene a esta ciudad, y donde los artífices de la arquitectura tienen bien que ver y aprender.  
En un aposento de estos están los huesos del conde de Niebla Don Enrique de Guzmán, que murió sobre esta ciudad,  de cuyos descendientes fue algún tiempo, como se dirá, adonde de ordinario se dice misa por su anima, se que han tenido y tienen buen cuidado los Duques de Medina sus sucesores. Otros creen que estos huesos son de Don Juan de Guzmán primero Duque de Medina, a quien los Moros la entregaron. Quitó de esta fortaleza esta memoria el Duque don Alonso año 1612 y pásola a Sanlúcar a la Iglesia de Nuestra Señora de la Caridad. 
Está en los altos de esta torre una campana que se vela todas las noches con centinelas y esta tocan a rebato cuando vienen enemigos a nuestro termino, haciendo seña a las torres que están en el así de noche como de día, y al repique e esta campana sale toda la gente de esta ciudad de a pie y de a caballo y se apercibe al arma corriendo los dichos rebatos por mar o tierra como la ocasión se ofrece.  
Tiene lo bajo de este Castillo muchos aposentos que se evidencia ser obra . . .  para su habitación y es cosa maravillosa ver bóvedas moriscas labradas con gran primor con muchos lazos muy galanos; están hoy como si fuese el próximo día que se acabaron de hacer. 
También tiene salas renovadas al uso Español que reedifico Don Álvaro Bazán, padre del primero Marqués de Santa Cruz, siendo Alcaide propietario de él, como se ha otro y vivían so en el con mujer e hijo; y no es poca loa para esta ciudad haberse criado en ella y su Castillo el dicho Marques; pues como todos sabemos y conocemos, fue uno de los valerosos Capitanes que España ha tenido y nuestros tiempos los conocieron. 

A rather unusual perspective of the Castle   (1834 - (Frederick Leeds Edridge)  (See LINK)
Tiene jardines dentro de árboles frutales, viña, hortalizas; hay bosque de conejos y puédelo haber de venado y de otros animales. Tiene muchos aljibes, plazas de artillería, y es tan grande que es po menos que la ciudad. Es obra morisca a lo que ahora parece aunque yo tengo para mí, según lo muestran algunas torres, que debió ser obra más antigua que de moros; y que consta por la historias tener los Romanos aquí las jarcias de sus navíos por la comodidad y capacidad de su puerto. . . 
Y la torre de la Calahorra así lo muestra como habemos dicho, puesto que tiene un letrero morisco en ella que no lo han sabido leer moros muy curiosos que lo han visto, solo dicen que aquellas letras muestran el año en que se reedifico aquella torre; pero todas estas fuerzas y murallas son flacas comparadas con los ánimos y valor de los Caballeros y otras gentes que han vivido y defendido esta Ciudad por muchos años casi sin muros y por los que tenia caídos y muy mal tratados, y por la parte del mediodía ningunos.
Perhaps it would be safe to say that from the moment that the Christians took over the place in 1462 and right up to 1704, the only real improvements or changes made by the Spanish authorities were to rearrange the internal fittings. Externally the only changes involved a periodical whitewash of the place - the remains of which can still be seen today and which gavie it its now long forgotten name of La Torre Blanca.

The tower played little part in the Anglo-Dutch capture neither of the Rock nor in the subsequent twelfth and thirteen sieges of 1704 and 1727 respectively.  A few decades later Thomas James, an officer stationed in the Rock in 1751, gave us his views on the Castle, its appearance and its origins, in his History of the Herculean Straits published in 1771. (See LINK) It is an extremely long and detailed account but difficult to follow. 
I shall now proceed with a description of the old Moorish castle at Gibraltar, which once was a stately palace, and a large, strong, and magnificent pile of fortification, before the use of artillery : and I may affirm, that when this castle was in its pristine grandeur, that it vied with any in Spain; either for Moorish strength, beauty, or situation: it was erected on the north end of the rock, and before the use of powder, was of great force; but by neglect it has almost gone to decay, 
The walls are principally of tapia: tapia is a cement moulded in frames, and plastered nicely over with a much finer cement; this manner of work was much used by the Moors, wherever they came; and the ingenious doctor Shaw tells us in his travels, that most of the walls of Tlemsan in Barbary have been moulded in frames, and consist of mortar made up of sand, lime, and small pebbles, which by being well tempered and wrought together, hath attained a strength and solidity equal to stone.  
He adds the various stages and removes of these frames are still observable; this is visible in the walls of the Moorish Castle in Gibraltar, and very justly styled by the engineer Armstrong in his ingenious history of Minorca , the most noble specimen of its kind in the world, having withstood the weather for so many ages, and was in the last siege ( 1727) almost proof against the enemies shot, which made but little impression on it.

Floor plan of the Tower of Homage ( Late 20th century - Manuel Francis Grech )
This castle was begun in the seven hundred and eleventh year of Christ, but when finished is hard to say; from seven hundred and eleven to this year of one thousand seven hundred and fifty-five is one thousand and forty four years. The walls of Algeciras as I have observed  . . . were of tapia but have attained the petrifactive power more than those of Gibraltar. 
The North bastion was originally a large tower; and the ordinance shed on the esplanade, the place where they built their gallies, which were launched through a large arch, now closed on the north of on the north of Water port . . . 
The "esplanade" was today's Casemates and "the place where they built the gallies" was the atarazana which was probably built around 1309 by the Spaniards. His dating of the Castle is incorrect.  
From the main street up the slope of the hill, likewise over Prince of Hesse's battery etc, as in the plain, is the second or middle castle, and above this the upper one. Many reservoirs, baths, and arched galleries are in these castles, especially the upper one where the foundations are of great ruins and some superstructures that are explained in the plan.  
In the north east angle of this upper Castle is what I call the upper tower, which you enter through an  arched stone barrier, which at right angles turns to the right; the covering is coved with a cupola: after you enter the barrier, you are inclosed within a wall that has a rampart of four feet broad, with thirty-one port holes, and twelve loop holes; and a semicircular tower in the center of this wall; under the ramparts are nine arched casemates with large loop holes for arrows to pass; from the above outward entrance you come into a second barrier, that has an octagonal barrier very neat; there formally were three passages from this small square (for the ground plot under each copula is square) that which fronts the entrance at eleven feet distance was by the Moors stopped up; and that which leads to the left, is an arched brick gallery of eighteen feet in length, under which the king's ( or governor's) guards and servants entered.

The Castle from the market place ( 1881 - Tristam Ellis )
That to the left was a winding square stair-case, up which none went but the royal family, and their friends, over every landing place which are square are cupolas of various forms, all built of brick, and differing from each other, and at the same time very neat and peculiar to the Moorish taste yet strike the beholder's eye with pleasure; there are loop holes on each landing place, fronting the enemy, which give light to the stairs, and the same time serves for a defence; on the third landing place there is an inner barrier that leads into a noble yet uncommon court-yard, as does likewise the gallery through which the soldiers etc passed round this court-yard are twelve pillars of brick each of which are in this form so that in fact each pillar is five, which I suppose was done to give the building a lighter look. 

Cross section of a pillar  (From the book ) 
Besides these pillars are eight imposts, that with the pillars, supported brick arches, which bear a terrass walk; the center of this yard was open at the top, which gave light to the whole, as no openings were left in the wall that surrounded this court; in this yard are two arched rooms, each of thirteen feet broad by twenty-four feet long; these rooms were for the governor's guards to sleep in. 
Returning back to the king's stair-case, which leads to the terrass ( terrace or pavement area ) was a square tower with loop holes as was likewise on the terrass fronting the enemy, that is the three lower castles; also the courtyard, so that if any disturbances should arise among the guards, they could be easily suppressed.  
On the fourth end of the terrass was a square tower, with loop holes, and under the upper platform of this tower is an arched room with loop holes and another room under that: an arched gallery, declining from the top of this terrass, went by the door of the upper room, where was a barrier that lead on the rampart of the upper castle wall, as does another gallery at the back of the king's stair-case, so that off this terrass you could once have walked right round this upper castle: from this terrass between two thin walls, you enter another platform, twenty feet broad by sixty feet long.

Moorish Castle     ( 1880s - T. F. Levick )
This terrace is over the guard rooms already mentioned; on this platform are two small square holes, each three feet by two, and made originally by the Moors, designing either to call the officers or to send and receive despatches, because it looks down into the guard room: eight feet from the easternmost hole is another barrier or entrance( that leads to the upper tower,) arched and after you have entered ten feet, another door place opens to the right: after you have entered, you then turn again to the right four feet, where you meet another strong arched barrier, which when entered you decend twelve feet then inclining eleven feet to the left, you arrive at a sally port, to the back of the tower that fronts the hill. 
This sally port was closed by the English; from above the entrance to the sally port, the roofs are arched so as to answer to the galleries. On the left of the first barrier is an arched entrance over which is a cupola; this is a small square of four feet, and on the right of the square is another arched door place; after passing through it  you ascend round a square newel, ( supporting pillar of a spiral staircase) which is open to the top, that gives light to the whole square winding stair-case; over each of these landing places are cupolas, or coves of various forms; with long arches or galleries, from one landing place to the other; when you have ascended some height, there is a door on your left, another on your right, and one in front. 
That on your left leads to the king's apartments as follow; after you enter a small square of five feet and a half by five and a half; still on your left you enter another door directly before which, at ten feet distance, you enter another door to the king's hot bath; the dressing room is fifteen feet, by five and a half; this room was divided into the lengthways where there are three doors, the first fronting the entering door of the long dressing room, and the bagnio the other half, which has a small  low door into the room where the furnace was lighted.

Moorish Castle and fortifications ( Unknown )
The bagnio has a copula, with holes at the top to let the steams through; returning out of the dressing room, and to your left, under an arch of seventeen feet and a half broad, you enter a room of ten feet each way; under this room, which is coved, is a reservoir of the same dimensions, which was always kept full of water; on the left of this room is the entrance into the king's apartments which is ten feet square, with a handsome cupola on the top.  
This room was the mosque and fronting is an arch of the same dimensions as the former, through which is a room with a window that fronts the mosque and on the fourth part of the square is a porch that leads into the king and queen's dressing room, which is twenty-four feet and a half, by nine feet and is coved. 
At the end of the above room, and in the same with the mosque, is the bed chamber coved, fronting the door, and at the end of the dressing room a window gives light to both the apartments, as does the former, the mosque etc there is no communication between the bed chamber and the mosque, but through the square room and dressing room. 
The door fronting the landing place of the stairs leads upon a battlement, which has turrets and loop holes; this rampant commands the terrass walk, likewise the court-yard where the guards are kept, and the three castles under it; also the front of the south east face of the scarp wall of the upper castle and the sally port already mentioned: this terrass rampart slopes from the parapet to the upper tower, in order to collect the rains, which run through an earthen pipe if six inches diameter into the reservoir under the square room that joins to the mosque and the dressing room already mentioned.

The Castle with its northern fortifications with Landport Gate middle bottom of the photograph   ( Late 19th century -  G. W. Wilson )     (See LINK)
The north-east wall part of this rampart  flanks the north east wall of the under castle; returning back to the stairs, you will ascend round the newel on four landing places, after which you arrive on the upper terrass, and on the top of the tower; at five feet distance from the top of these stairs is an earthen pipe of the same dimensions as that below; this pipe collects the rains that fall on the upper flat, it is set into the wall, and runs perpendicular down to the rampart at five feet distance from that which leads to the reservoir. 
This upper terrass is thirty-nine feet high from the foundation on the south side, forty nine on the east, twenty-seven on the north, and forty on the west; on this terrass is a rampant parapet with loopholes. There are two Moorish inscriptions, one on the battlement near the mosque, and the other at the entrance of the upper castle, which inscriptions being very much deface, and in old Arabic characters, few Moors could read them: and to say true not any of them, until I took the following method: an Algerine Moor being confined to the upper castle, I waited on him to get a translation of those inscriptions, which he not only read but likewise wrote in Spanish. 
Pleased with this success I returned to Mr. Benedic (a very sensible Jew) acquainting him of my success in part, not taking any notice of my having them in writing: upon which the above gentleman introduced me to a learned Moor belonging to Tangiers ( a son of the late basha Hamet ) who held the prisoner in great contempt in regard to his knowledge: he went with me and the Jew up to the Castle, read and wrote the inscriptions before the imprisoned Moor was sent for, then I shewed the first copy, which agreed with young Hamet's in every point except the king's name: the prisoner insisted that Bene-has-fin was the king's name, and Hamet Ebn Al Hejaj, who by dint of argument, prevailed. 
James follows this up with a detailed discussion on the two inscriptions mentioned above (see LINK) together with engravings of their Arabic script but offers no conclusion as to what the dedications actually mean.

In 1772, however, the British traveller and antiquarian Francis Carter (see LINK) also included a rather more readable description of the Castle in his book - Journey from Gibraltar to Malaga.
The Torre de Hominage in all Moorish Castles is the highest and most elevated tower, so called because therein the Alcalde used at the entrance into his government to take oaths of fealty in the hande of the king or somebody appointed to represent him. That of this castle is entire, but has long since been shut up and made use of as a magazine for powder; under it is a parapet defended by a semicircular tower. 
The few other buildings are quite in ruins; among those to be traced and worth our curiosity, is a little square building  to the eastward formerly a mosque, which would never have been known as a place of devotion, were it not for an Arabic dedication on the wall . . . . 
A neat Morisque court, adorned with a colonnade of twelve groups of brick pillars, is near the chapel; they give a pleasing idea of eastern architecture and support a terrace twenty four feet high, paved with bricks; in this yard are two noble rooms; each twelve feet broad and twenty-four long. 
As water was a chief and capital article in ancient fortifications and here none was to be got out of the rock, the architect has taken care to cove and pave the roof as well as of the Torre del Hominage, as of the other buildings; conveying the rain water by the means of large earthen pipes into a reservoir, constructed for that purpose under the apartments, twelve feet square, still entire; there are not wanting those, who still have this reservoir to have been a bath, and shew you another room, where they assure you was a royal bagnio; nay they go so far as to parcel out each plot and wall into kings and queens dressing rooms, bed chambers, halls of audience, guardrooms, and all the necessary apartments of  king's residence; but those who know from history, that Gibraltar never was a court, and that no prince, Christian or Moor ever made in it any other than a casual residence, landing or embarking for Barbary, will give no credit to such romances.

A view from the town   ( Late 19th century - Unknown )
True it is that Gibraltar being esteemed by the Moors the key into Spain, this castle was built as strong as possible and no cost spared to render it impregnable; a proof of which is the entirements of the Torre del Hominage, and of the other walls still standing; and their having sustained the injuries of time and frequent sieges, above a thousand years. Again, anybody who had opportunities of viewing the castles of Cordova, Granada and Malaga, are acquainted with the gold and azure, the Mosaic stucos, the superb inscriptions, and other pompous characteristics, of a royal Moorish palace which they will in vain look for in Gibraltar. 
Over the South Gate of this castle which fronts the soldier's hospital, is an Arabick inscription that ascertains the exact period of its erection, and which, together with that on the wall of the mosque, have been already published by an officer of this Garrison; his translation of both very nearly agree with mine, which were given me in Spanish by a Barbary Jew, well versed in Arabic idiom, and confirm the correctness of that gentleman's copy.
The rest of the chapter is another lengthy explanation of his interpretation of the inscriptions and his almost certainly incorrect dating of the Castle as an 8th century building. From the general gist of his descriptions of the building itself it would seem that the place had been abandoned by the British and was now a semi-derelict but picturesque ruin.  

The view from the top of the Castle     ( 1830 - Thomas Staunton St Claire  )   (See LINK)

A few decades later the Spanish historian Ignacio López de Ayala in his Historia de Gibraltar which was published in 1782 describes the castle as follows:
Sobre su puerta meridional se conserva una inscripción arábiga, que denota el tiempo de su fundación. De los tres recintos que tenia queda solo la torre del Omenage, los cimientos del segundo, i parte del tercero por donde mira al norte, para cubrir la ciudad de las balas que arroja el campo de los españoles. Ofrece repetidas señales de los balazos que por esta parte ha recibido.
All of which offers little that is new. A few years later, during the Great Siege which took place between 1779 and 1783, the castle is hardly given a mention. Nevertheless, its northern position close to the Spanish lines ensured that it suffered considerable damage from enemy fire. According to Arthur de Capell Brooke's (see LINK) writing in 1831:
The marks of this celebrated event, which engaged the attention of all Europe, and which has given a fame to Gibraltar that will last until the rock itself crumbles away, are still to be seen on the walls of the ancient Moorish castle which overlooks the Spanish lines, and bolts and splinters of shells are still frequently found scattered on different parts of the rock. 
Shortly after the end of the siege and right up to the modern era the Castle began its new and rather unfortunate metamorphosis into a prison - first military then civilian. One rather odd consequence of this use was that during the various yellow fever epidemics (see LINK) in the early 1800s, the medical authorities noticed that all the prisoners confined in the provost seemed unaffected by the disease. This was used to argue that seclusion effectively prevented the disease and gave credence to those who argued that it was contagious. The real and perhaps rather ironic reason was that the incarcerated prisoners were rarely in a position to be bitten by mosquitoes. 

Passageway with prison cells in the Castle  ( 21st century - Michael Fa ) 

In the 1970s merlons or crenellations were added to various sections of the Castle for rather misplaced aesthetic reasons. The Moorish Castle will never be able to compete in prettiness with its romantic brothers on the River Rhine. Anachronistically decorated or not, today the Castle is a tourist attraction to Gibraltar's many visitors.

The crenellated look  ( 20th century - Unknown )

Perhaps I should start off with a confession; I personally have never been inside the Castle. Also and although I am sure I must have seen them when I lived on the Rock as a young man, I do not have any memory of what the Gatehouse or the nearby flanking 'beck tower' actually looked like. As regards an answer to the question of who was actually responsible for the present Moorish Castle, perhaps it would be worth while to have another look at some of the main dates mentioned above in more detail.

711 - Tarik ibn Zayed puts Gibraltar on the map
1025 - Algeciras - perhaps together with Gibraltar - ruled by Hammudies
1067 - Al Mutadid of Seville orders Algeciras to improve the Rock's fortifications
1081 - Al Mutadid hands over Algeciras and Gibraltar to the Almoravid Yusuf
1160 - Abd-al Mu'min founds the town of Medinat al Fath
1292 - Loss of Tarifa to Sancho IV of Castile
1294 - Marinids sold Algeciras and Gibraltar to the Nasrids of the Kingdom of Granada
February 1333 - Beginning of the Third Siege in which Abu l-hasan takes Gibraltar
June 17th 1333 - End of the Third Siege
June 26th 1333 - Beginning of the Fourth Siege - Alfonso XI tries to retake the Rock
August 1333 - End of the Fourth Siege

Which leads to the question - how on earth would Abu l-hassan ever finds time to order and build his new castle? He could certainly not have done it in 10 days. There are at least two possibilities - the castle had already been built by somebody else - despite literature to the contrary - or it was built after August 1333 perhaps with a little help from his ungrateful son Abu Inan Faris whose involvement in improvements to the defences of Gibraltar is well documented. It also means that the scars on the east face could not have been caused by Alfonso's siege machines. To continue the dates:

1342 - Beginning of the Siege of Abu l-hasan's city of Algeciras by Alfonso XI 
1344 - End of the Siege of Marinid Algeciras 
1348 - Abu Inan Farris overthrows his father Abu l-hasan 
1349 - Ibn Batutta visits Gibratar and atributes its large keep to Abu'l Hassan 
1349 - Beginning of the Fifth Siege - Alfonso XI tries again
1350 - Alfonso XI dies of the bubonic plague
1374 - The Nasrid Muhammad V from Granada receives Gibraltar back from the Marīnids
1462 - Spaniards finally capture Gibraltar from the Moors.

As mentioned previously, the most likely candidate for a 'precurser' castle still semms to be Abd al mumin and the best bet for the creator of the present structure is probably Abu Inan Farris. But Kevin Lane's, theory that it might be the work of Muhammad V is by no means farfetched. In fact it corresponds roughly with the analysis offered by Norris in his paper on early Islamic settlements in Gibraltar (see LINK) and of which a summary as regards his thought on the Castle and its precincts are shown below.

Origins of the Moorish Castle   ( From  - H.T. Norris 1961 )

In the final analysis it will require more research and archaeological work if we are ever to find out who was responsible for building the Moorish Castle.  I suspect, however, that there are at present not enough people in Gibraltar that really care.