When Morocco was later united under the Alaouites, the cost of maintaining the garrison against Moroccan attack greatly increased, and Parliamentary refusal to provide funds for its upkeep partly because of fears of 'Popery' and a Catholic succession under James II, forced Charles to give up possession.
Tangier has the best natural harbour on the western end of the Strait of Gibraltar, allowing its owner to control naval access to the Mediterranean.
Mulai al-Rashid (known as "Tafileta" by the English) took Fes in 1666 and Marrakesh in 1669, essentially unifying all of Morocco except the ports occupied by Portugal, Spain, and England.
The Treaty of the Pyrenees in November 1659 specifically pledged that Louis XIV of France would withdraw support from Portugal under the Braganzas and released Spanish troops and ships to pursue the continuing Portuguese Restoration War.
[4] As part of the dowry, Portugal was to hand over the port of Tangier and the island of Bombay (now Mumbai) but it is unclear when those detailed terms were agreed upon or became publicly known.
[6] The anchorage was not particularly safe for shipping[7] and, exposed to the Atlantic and to destructive winds from the east, it was expensive to maintain, requiring significant improvement.
Johan De Witt, the "Grand Pensionary", was a confirmed Republican and had excluded William through the 'secret' (but widely leaked) Act of Seclusion annex to the Treaty of Westminster with Cromwell.
[15] In France, Cardinal Mazarin was at the height of his powers following the formation of the League of the Rhine in 1658; the defeat—with the help of Cromwell's army and navy—of the Prince of Condé and Spain at the Battle of the Dunes the same year; and the signing of the Treaty of the Pyrenees on 7 November 1659.
In July 1661, Louis sent the Comte d'Estrades as his ambassador to London, and it is clear from the instructions and correspondence between them that the treaty between England and Portugal was welcomed by France.
[21] At the time, France had no significant Mediterranean or East Indies naval presence, and English possession of Tangier and Bombay posed no apparent threat.
King Charles II's government in exile was, technically, allied to Spain and so pledged to resist Portugal's independence and to raise forces against France by the 1656 Treaty of Brussels, the converse of the Commonwealth position.
Sandwich left London on 13 June for the fleet assembled at the Downs and from there, with John Lawson as Vice-Admiral, sailed to Algiers, where he arrived on 29 July.
Sandwich left Lawson to blockade Algiers, and proceeded to Lisbon, not yet in his official capacity as an Ambassador Extraordinaire, but rather to meet a second English fleet which was to take possession of Tangier.
The marriage, by proxy, of Charles and Catherine was notified to the Governor of Tangier (Don Luis D'Almeida) by letter from the King of Portugal on 4 September 1661.
Still expecting trouble from Spain or the Netherlands, Lawson's squadron joined him, unsuccessful in subduing Algiers (although a storm severely damaged the harbour there the next year and enabled a peace later).
In England, a Tangier Committee of the King's Privy Council was appointed, with its members including Samuel Pepys, Secretary to the Admiralty, and Prince Rupert of the Rhine.
[38] On 14 January 1662, the Portuguese garrison consisting of 140 cavalry attempted a sally out into the surrounding countryside, taking about 400 head of cattle, and also capturing 35 women and girls.
Unsurprisingly, the Moroccans numbering around 100 counter-attacked and recovered the booty, killing some 51 of the Portuguese, including the Aidill (the military commander) and twelve knights, pursuing the remainder of the force to the city gates.
Sandwich sent parties of seamen ashore to man the defences, under the command of Sir Richard Stayner, effectively (but not formally) taking control of the city to help protect it against attacks by Ghaïlan (supported by Spain) and, perhaps, to ensure a withdrawal by the Portuguese.
The Tangier Garrison (his new regiment augmented by units from Flanders) disembarked on 30 January and the city keys were handed over with due ceremony.
The available accommodation was completely insufficient for the three thousand or so troops, who had little in common (neither language nor, for the most part, religion or custom) with the Portuguese population; the money (such as was available to the new occupants) was English currency, unfamiliar to the townspeople.
Given that Portugal had been seeking (and, latterly, expecting) to dispose of Tangier; had a major war with Spain at home; and needed to raise a very significant dowry for the marriage; it is not surprising that some neglect may have crept in but it is also clear that Peterborough was not well prepared.
[43] Peterborough reported that the Portuguese, leaving, had carried off the very ffloers, the Windowes, and the Dores,[44] but since most of the inhabitants, and their possessions, were repatriated by the English fleet, that may be an exaggeration.
Each redoubt had four hundred men guarding the excavation site, while to the front balls of spikes, stakes and piles of gunpowder-and-stone mix, which acted as basic landmines, were laid.
The King's Battalion landed in July 1680, and fierce attacks were made against the Moors, who had gained a footing on the edge of the town, finally defeating them by controlled and well-aimed musket fire.
The so-called Popish Plot in England had intensified the dread of Catholicism, and the King's frequent request for more troops to increase the size of the garrison raised suspicions that a standing army was being retained in Tangier to ensure both a Catholic succession and the political system of absolute monarchy.
The fundamental problem was that in order to keep the town and harbour free from cannon fire the perimeter of the defended area had to be vastly increased.
Although the attempt by Sultan Moulay Ismail of Morocco to seize the town had been unsuccessful, a crippling blockade by the Jaysh al-Rifi ultimately forced the English to withdraw.
Dartmouth was also able to purchase the release of many English prisoners from Ismail's bagnio, including several officers and about 40 men, some of whom had spent 10 years in the hands of the Moroccans.
The main force of 2,830 officers and men and 361 wives and children finally completed the demolition of the harbour wall and fortifications, and evacuated the garrison during the early months of 1684.