Great Siege of Gibraltar The Great Siege of Gibraltar was an unsuccessful attempt by Spain and France to capture Gibraltar from the British during the American War of Independence . This was the largest action fought during the war in terms of numbers , particularly the " Grand Assault " of 18 September 1782 . At three years and seven months , it is the longest siege endured by the British Armed Forces . Background . In 1738 a dispute between Spain and Great Britain arose over commerce between Europe and the Americas . Initially , both sides intended to sign an agreement at the Spanish Royal Palace of El Pardo , but in January of the following year , the British Parliament rejected the advice of Foreign Minister Robert Walpole , a supporter of the agreement with Spain . A short time later , the War of Jenkins ' Ear began , and both countries declared war on 23 October 1739 , each side drawing up plans to establish trenches near Gibraltar . Seeing these first movements , Britain ordered Admiral Vernon to sail from Portobello and strengthen the squadron of Admiral Haddock who was already stationed in the Bay of Gibraltar . The passage of years failed to break the hostilities in the region . Then on 9 July 1746 , King Philip V of Spain died in Madrid . His successor , Ferdinand VI , soon began negotiations with Britain on trade . The British Parliament was amenable to such negotiations , and even looked favourably upon lifting the British embargo on Spain and possibly ceding Gibraltar . The neutrality adopted by Ferdinand VI quickly ended with his death in 1759 . The new king , Charles III , was less willing to negotiate with Great Britain . Instead , he signed a Family Compact with Louis XV of France on 15 August 1761 . At that time France was at war with Britain , so Britain responded by declaring war on Spain and capturing the Spanish colonial capitals of Manila and Havana . Two years later , after cessation of hostilities , Spain recovered Manila and Havana in exchange for Spanish holdings in Florida as part of the 1763 Treaty of Paris . In the years of peace that followed both France and Spain hoped for an opportunity to launch a war against Britain on more favourable terms and recover their lost colonial possessions . Following the outbreak of the American War of Independence , both states supplied funding and arms to the American rebels , and drew up a strategy to intervene on the American side and defeat Britain . On 12 April 1779 , France and Spain signed the Treaty of Aranjuez wherein they agreed to aid one another in recovering lost territory from Britain . Then , in June 1779 , Spain declared war on Great Britain , France having done so the year before . France and Spain sought to secure Gibraltar , which was a key link in Britain ' s control of the Mediterranean Sea , and expected its capture to be relatively quick — a precursor to a Franco - Spanish invasion of Great Britain . Opposing forces . The Spanish blockade was directed by Martín Álvarez de Sotomayor . Spanish ground forces were composed of two battalions of Royal Guard s , another two of Walloon Guard s , with artillery and cavalry , about 13 , 000 in all . The artillery was commanded by Rudesindo Tilly , while the cavalry and the French dragoon s were headed by the Marquis of Arellano . Antonio Barceló commanded the maritime forces responsible for blockading the bay , and established his base in Algeciras , commanding a fleet of several xebec s and gunboat s . A fleet of eleven ships and two frigate s were placed in the Gulf of Cadiz under the command of Luis de Córdova y Córdova to block the passage of British reinforcements . When the Rock was first besieged , the British garrison consisted of 5 , 382 troops ; General Eliott was the Governor - General , and his determined handling of the defence inspired all the troops under him with the greatest confidence . All the defences were strengthened , and many of the infantry , including picked men , assisted the artillery in serving the guns . The garrison included contingents of Hanoverian and Corsican troops . The British had anticipated an attack for some time , and a number of ships had sailed to reinforce and supply Gibraltar . They stepped up their preparations after France entered the conflict in 1778 , although the French were initially more concerned with sending forces to America , and it was not until Spain joined the war that the long - expected siege commenced . Siege begins . The combined Spanish and French fleets blockade d Gibraltar from the sea , while on the land side an enormous army constructed forts , redoubt s , entrenchments , and batteries from which to attack . General Eliott formed a corps of sharpshooter s . As the winter of 1779 came down the garrison began to suffer from want of fresh provisions , which became very scarce and dear . Bread was almost impossible to get , and was not permitted to be issued except to the sick and children . Salt meat and biscuits , and not much of that , soon became the food of the troops , with an occasional issue of four ounces of rice as a full day ' s ration . Fuel was exhausted , and fires were only made with difficulty , the salt - encrusted timbers of old ships broken up in the harbour for the purpose . To the rigours of the siege was added a violent outbreak of scurvy among the troops , due to the want of fresh vegetables and medicines . As the winter wore on , the scanty store of food grew so alarmingly low that the already meagre ration was reduced to just enough to keep life in the bodies of the men . But their morale remained high and the troops continued to take their turns at trench or battery , and endured the inclement weather and the shortage of food with fortitude . The Spanish were forced to commit increasing number of troops and ships to the siege , postponing the planned Invasion of England , due to this and the cancellation of the Armada of 1779 . First naval relief . Admiral George Rodney , after capturing a Spanish convoy off Cape Finisterre on 8 January 1780 , and eight days later defeating a Spanish fleet at the Battle of Cape St . Vincent , reached Gibraltar in the spring of 1780 , bringing reinforcements of 1 , 052 men and an abundance of supplies . This greatly heartened the garrison , who , as soon as Rodney ' s fleet left , found the fortress as closely besieged as ever . The British defenders resisted every attempt to capture Gibraltar by assault . While the two sides unceasingly exchanged shot and shell , by the end of the summer provisions again began to be meagre and scurvy began to reappear , reducing the effective strength of the garrison . Through the use of small , fast - sailing ships that ran the blockade they were able to keep in touch with the British forces on Minorca until 1782 , when that island fell . Throughout the second winter the garrison faced foes , elements , disease , and starvation , until in April 1781 another British fleet succeeded in reaching the harbour with stores and food . Second naval relief . On 12 April 1781 Vice Admiral George Darby ' s squadron of 29 ships of the line escorting 100 store ships from England laden for Gibraltar entered the bay . The Spanish fleet was unable to intercept Darby ' s relief . The Spanish , frustrated by this failure , opened up a terrific barrage while the stores were unloaded , but only did great damage to the town . The civilian population of Gibraltar sailed with Darby for England on 21 April , again without hindrance from the blockading Spanish and French fleet . Sortie . The French and Spanish found it was impossible to starve the garrison out . They therefore resolved to make further attacks by land and sea and assembled a large army and fleet to carry this out . But on 27 November 1781 , the night before they were to launch the grand attack , half the British garrison filed silently out of their defence works and made a surprise sortie . The sortie routed the whole body of the besieging infantry in the trenches , set their batteries on fire , blew up and spiked their cannon , destroyed their entrenchments , and killed or took prisoner a large number of the Spaniards . The British did damage to the extent of two million pounds to the besiegers ' stores and equipment that night . Spanish losses were over 200 and Governor Eliott claimed many were ' killed on the spot ' because of the surprise . As the Spanish recovered and prepared to launch a counter - attack , the British withdrew back inside their fortifications . This reverse postponed the grand assault on Gibraltar for some time . Still , the Spaniards closely maintained the siege . A new depressing gun - carriage was devised by George Koehler which allowed guns to be fired down a slope . This was demonstrated on 15 February 1782 at Princess Royal ' s Battery . This new carriage enabled the defending guns to take advantage of the height of the Rock of Gibraltar . The Grand Assault . Eventually on 13 September 1782 the Bourbon allies launched their great attack ; 5190 fighting men both French and Spanish aboard ten of the newly engineered ' floating batteries ' with 138 heavy guns , as well as 18 ships of the line , 40 Spanish gunboats and 20 bomb - vessels with a total of 30 , 000 sailors and marines . They were supported by 86 land guns and 35 , 000 Spanish and French troops ( 7 , 000 – 8 , 000 French ) on land intending to assault the fortifications once they had been demolished . An ' army ' of over 80 , 000 spectators thronged the adjacent hills over the Spanish border , among them the highest families in the land , assembled to see the fortress beaten to powder and ' the British flag trailed in the dust ' . The 138 guns opened fire from floating batteries in the Bay and the 86 guns on the land side , directed on the fortifications after weeks of preparatory artillery fire . But the garrison replied with red - hot shot to set fire to and sink the attacker ' s floating batteries and warships in the Bay . In that great conflict , the British destroyed three of the floating batteries , which blew up as the ' red - hot shot ' did its job . The other seven batteries were scuttled by the Spanish because they were too heavily damaged to continue the fight . In addition 719 men on board the ships ( many of whom drowned ) were casualties . Capture of the " San Miguel " . On 10 October a Spanish ship of the line " San Miguel " of seventy two guns under the command of Don Juan Moreno was captured by the garrison after it had lost its mizzen mast in a storm . Cannon fire from the King ' s Bastion was fired at the vessel some of which penetrated causing damage and casualties . The " San Miguel " then trying with great difficulty to get out of danger was grounded . Gunboats from the garrison quickly captured her being too close to the guns of Gibraltar . Moreno agreed to surrender to avoid any further bloodshed , and a total of 634 Spanish sailors , marines and dismounted dragoons were captured . An attempt on 17 December to bombard the " San Miguel " by the Spanish and French with mortars failed causing only minimal damage . By this time the powder magazine had been removed or thrown overboard . Final relief . In Britain the Admiralty considered plans for a major relief of Gibraltar , opting to send a larger , but slower fleet , rather than a smaller faster one . In September 1782 a large fleet left Spithead under Richard Howe , arriving off Cape St Vincent on 9 October . The following evening a gale blew up , scattering the Spanish and French fleet . This allowed Howe to sail unopposed into Gibraltar . A total of 34 ships of the line escorted 31 transport ships which delivered supplies , food , and ammunition . The fleet also brought the 25th , 59th , and 97th regiments of foot bringing the total number of the garrison to over 7 , 000 . Howe then sailed out and fought an indecisive battle with the combined allied fleet before withdrawing to Britain in line with his orders . The siege was continued for some months longer , but in the spring of 1783 a preliminary peace agreement brought the cessation of hostilities . Finally , in February 1783 the siege was lifted . The French and Spanish troops retired disheartened and defeated , after three years and seven months ' conflict . Aftermath . Although the Spanish attempted to regain Gibraltar at the negotiating table , they preferred to retain Minorca and territories in the West Indies , and the final peace treaty left Gibraltar with the British . The victorious British garrison sustained a loss of 1 , 231 men , and expended 8 , 000 barrels of gunpowder . George Augustus Eliott was made a Knight of the Bath and was created 1st Baron Heathfield of Gibraltar . The Treaties of Versailles reaffirmed previous treaties . Many British regiments engaged in the defence were given the badge of the Castle of Gibraltar with the motto ' Montis Insignia Calpe ' , in commemoration of the gallant part it took in the ' Great Siege ' . In popular culture . Music . In 1782 Wolfgang Amadeus Mozart composed " " a piece of music commemorating the Great Siege . Mozart was known to have a favourable view of the British . Paintings . The 1783 painting " The Defeat of the Floating Batteries at Gibraltar , September 1782 " was a work by an American artist John Singleton Copley depicting the event . Another 1783 painting is by James Jefferys . His painting of the Floating batteries at Gibraltar is at the Maidstone Museum & Art Gallery . A 1789 work by American painter John Trumbull , " The Sortie Made by the Garrison of Gibraltar , 1789 " , covered the 1781 sortie that the garrison had made against the besiegers . Poetry . Alexei Tsvetkov ' s poem " The Rock " ( Russian : Скала ) is inspired by the siege .