Jervis' ships besieged Cádiz but were repelled by unexpected Spanish resistance. The Spaniards, under Vice-Admiral Mazarredo, organized a flotilla of small gunboats converted from yachts. With a clear advantage in the harbour's shallow waters, these vessels manoeuvred in the darkness and savaged Jervis' heavy ships of the line, striking at their vulnerable areas with impunity. Coastal batteries opened fire, joined by Spanish warships anchored at harbour, and drove the attackers back, causing the British to lose grip over the blockade and allowing several merchant convoys to slip in and out of the port.