Spain's 16th-century maritime supremacy was demonstrated by the victory over the Ottomans at Lepanto in 1571, and then after the setback of the Spanish Armada in 1588, in a series of victories against England in the Anglo-Spanish War of 1585–1604. However, during the middle decades of the 17th century Spain's maritime power went into a long decline with mounting defeats against the United Provinces and then England; that by the 1660s it was struggling grimly to defend its overseas possessions from pirates and privateers.