The Santa Ana class was built for the Spanish fleet in the 1780s and 1790s as heavy ships of the line, the equivalent of Royal Navy first rate ships. The other ships of the class were the Santa Ana, Mexicano, Salvador del Mundo, Conde de Regla, Real Carlos, Reina María Luisa and Príncipe de Asturias. Three of the class were captured or destroyed during the French Revolutionary Wars.
In 1793, during the War of the Pyrenees, San Hermenegildo was the flagship of the squadron under Federico Gravina in the Mediterranean operating off Catalonia.[1] The squadron subsequently participated in the evacuation of Toulon during the last stage of the siege, alongside the British fleet under Vice-Admiral Samuel Hood.
In 1800, San Hermenegildo was refitted at Ferrol, repairing a number of faults that had existed since her construction and increasing the weight of cannon that the ship could carry. Later in the year San Hermenegildo participated in repelling the Ferrol Expedition.
By July 1801, San Hermenegildo was at Cádiz. When a French squadron repelled a British force at the First Battle of Algeciras on 6 July, San Hermenegildo joined the squadron sent to escort the French from Algeciras back to Cádiz. During the night of 12 July the combined force was returning through the Straits of Gibraltar when a British squadron attacked them at the Second Battle of Algeciras. During the confused night action which followed, HMS Superb cut through the rearguard and between Real Carlos and San Hermenegildo. The Spanish ships opened fire, striking one another, as a fire spread across Real Carlos's decks. In the darkness, the two huge Spanish ships collided, fire spreading out of control until both exploded in a fireball that could be seen from shore. More than 1,700 men were killed in the blast, one of the greatest losses of life at sea to that time.