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, driving away the rest.