happen, and after a fruitless four-month blockade he gave up the attempt. Gibraltar received the title of "Most Loyal" from the Spanish crown in recognition of its faithfulness. Barbary pirate raids and wars with other European powers Despite continuing external threats Gibraltar was neglected by the Spanish crown and its fortifications fell into disrepair. Barbary pirates from North Africa took advantage of the weak defences in September 1540 by mounting a major raid in which hundreds of Gibraltar's residents were taken as hostages or slaves. The Shrine of Our Lady of Europe was sacked and all its valuables were stolen. Many of the captives were subsequently released when a Spanish fleet commanded by Bernardino de Mendoza intercepted the pirate ships near Alborán as they were bringing ransomed hostages back to Gibraltar. The Spanish crown belatedly responded to Gibraltar's vulnerability by building the Charles V Wall to control the southern flank of the Rock and commissioning the Italian engineer Giovanni Battista Calvi to strengthen other parts of the fortifications. The seas around Gibraltar continued to be dangerous for decades to come as Barbary pirate raids continued; although a small squadron of Spanish galleys was based at the port to counter pirate raids, it proved to be of limited effectiveness and many inhabitants were abducted and sold into slavery by the pirates. The problem worsened significantly after 1606, when Spain expelled the Moriscos;– Muslims who had converted to Christianity. Many of the expellees were evacuated to North Africa via Gibraltar but ended up joining the pirate fleets, either as Christian slaves or reconverted Muslims, and raided as far afield as Cornwall. The threat of the Barbary pirates was soon joined by that of Spain's enemies in northern Europe. On 5 May 1607, during the Eighty Years' War, a Dutch fleet under Admiral Jacob van Heemskerk ambushed a Spanish fleet at anchor in the Bay of Gibraltar. The Dutch won an overwhelming victory in the Battle of Gibraltar, losing no ships and very few men while the entire Spanish fleet was destroyed with the loss of 3,000 men. The Spanish and Dutch declared a temporary truce in 1609 (the Twelve Years' Truce) and resumed hostilities in 1621, when a joint Dutch and Danish fleet arrived in the Strait to attack Spanish shipping. This time the Spanish succeeded in capturing and sinking a number of the attackers' ships in a second Battle of Gibraltar,