Four years later, in 1797, she was part of a Spanish fleet under Teniente General José de Córdoba y Ramos that fought against the British at the Battle of Cape St. Vincent.
Mortally wounded, the Basque-born Churruca prohibited his officers from surrendering and ordered them to continue returning fire whilst he remained breathing.
His officers kept their word, even after Churruca died and command of the ship had been passed to the second-in-command, Francisco de Moyna,[citation needed] who continued the fight until he himself was killed.
In honour of Churruca's courage, the cabin he had occupied while alive bore his name on a brass plate, and all who entered it were required to remove their hats as a mark of respect for a gallant enemy.
[citation needed] She initially served as a base hulk at Gibraltar from 1805 to 1808 before being recommissioned in September 1808 as a prison ship under Commander John Gourly.
[citation needed] During the Peninsular War San Juan was fitted to act as flagship to a flotilla of gunboats based in Gibraltar.
Her final commission began in October 1814 when she reverted to her original role as a base hulk under the command of Lieutenant Charles M'Kenzie.