Operations in Cádiz preceding the battle
After the ending of the Anglo-Dutch War, Oliver Cromwell turned his attention to England's traditional enemy, Spain. He was seeking a return to a policy of attacks on Spanish trade and shipping routes, whose success in the time of Elizabeth I had acquired a legendary status.
In August 1655, Robert Blake had blockaded the port of Cádiz in the hope of intercepting a Spanish treasure fleet, but it did not sail and remained in the Americas. The fleet sailed to England for a refit in October 1655, before returning the following April. During this time a Spanish fleet had docked in Cádiz, and the harbor was deemed too well defended to attack successfully. Consequently, the two generals leading the English fleet (Blake and Edward Montagu) sailed for Tangier to take on water and supplies. From Tangier the best ships in the fleet sailed to Lisbon to support the ratification of a treaty between Portugal and England, before returning full attention to the blockade. This continued throughout summer 1656 as the Spanish avoided any aggressive actions, allowing the majority of the English fleet to raid ports all over Spain and North Africa (including Vigo and Málaga, where they sunk 9 Spanish ships.) 10 of the 40 ships in the fleet were recalled to England in July, before all but 8 of the remaining ships sailed to Lisbon once again to restock the fleet. These 8 ships were left in the command of Richard Stayner in order to continue the blockade of Cádiz.