On 17 September 1805, after completing a small refit of his ship in Portsmouth, Captain Harvey was superseded in command of "Agamemnon" by Captain Sir Edward Berry, who had previously commanded Nelson's flagship, , at the Battle of the Nile. On 3 October she departed Spithead to join Vice-Admiral Nelson's fleet blockading Villeneuve's combined fleet in Cádiz. En route, "Agamemnon" fell in with a French squadron, consisting of six ships of the line and several smaller vessels, which gave chase. Succeeding in evading the French, "Agamemnon" joined the blockading squadron on 13 October, and when Nelson laid eyes on the approaching ship he reportedly exclaimed: "Here comes that damned fool Berry! Now we shall have a battle!" In misty conditions on 20 October, "Agamemnon" captured a large American merchant brig, which she then took in tow. Not long after, signalled to "Agamemnon" that she was sailing straight towards an enemy fleet of 30 ships—Villeneuve's fleet had left port.