Captain Solomon Ferris commissioned her in March 1801, and under his command she sailed from Spithead on 6 June 1801. She joined Rear-Admiral Sir James Saumarez in Cawsand Bay on 12 June, ready to sail for the Mediterranean.
On the morning of 6 July Saumarez’s squadron of six line-of-battle ships attacked French Admiral Linois’s three line-of-battle ships and a frigate in Algeciras Bay. Hannibal was the last in and she anchored ahead of HMS Caesar, Saumarez’s flagship. From there she fired broadsides for about an hour. At about 10 o’clock Ferris Saumarez ordered Hannibal to cut her cables and move to support HMS Pompee by engaging Formidable, Linois’s flagship. As Hannibal maneuvered, the variable winds pushed her into shoal water and she grounded. Still, from his immobile position, Ferris maintained fire on Formidable with those of his forward guns that could bear on her; the other guns fired at the town, batteries and gunboats. Saumarez sent boats from Caesar and HMS Venerable to assist Hannibal but a shot demolished Caesar’s pinnace; Ferris then used one of his own cutters to send them back to Caesar. At about 1:30pm the British ships withdrew to Gibraltar, leaving Hannibal immobile and unsupported.
Ferris consulted with his officers and decided that further resistance was pointless and that the only way to save the lives of the remaining crew was for Hannibal to strike. By this point Hannibal’s fire had dwindled to almost nothing so Ferris ordered his men to shelter below decks. He then signalled capitulation by hoisting Hannibal’s ensign upside down. The battle had cost Hannibal 75 men killed, 62 wounded and six missing.
Commander George Dundas, deceived by a signal from Hannibal, sent boats from HMS Calpe to save Hannibal’s crew. The French detained the boats and their crews, including Calpe’s lieutenant, T. Sykes; after firing several broadsides at the enemy’s shipping and batteries, Calpe returned to Gibraltar. The French and Spanish were unable to repair Hannibal quickly enough for her to take part in the eventual defeat of the Franco-Spanish squadron at the Second Battle of Algeciras several days later.
Sir James Saumarez then arranged to exchange the men from St Antoine, which the British had captured in the second part of the battle, for the men from Hannibal and Calpe. A court martial on HMS Gladiator in Portsmouth on 1 September honourably acquitted Captain Ferris, his officers and crew for the loss of their ship.
Read more at Wikipedia