San Juan Nepomuceno was a Spanish ship of the line launched in 1765 from the royal shipyard in Guarnizo (Cantabria). Like many 18th century Spanish warships she was named after a saint (John of Nepomuk). She was a solidly built ship of proven seaworthy qualities. Captured by the British Royal Navy during the Battle of Trafalgar, the ship was renamed first HMS Berwick, then HMS San Juan. The ship was discarded in 1816.
Her sister ships were San Pascual, San Francisco de Asis, San Lorenzo, Santo Domingo and .
She was originally fitted with a total of 74 cannons: 28 24-pounders, 30 18-pounders, 8 12-pounders and 8 8-pounders, and was manned by 8 officers, 11 midshipmen, 19 leading seamen and 492 able seamen (530 total). Her supply capacity was for 60 days victuals and 80 days water.
In 1793, she took part in the Anglo-Spanish occupation of Toulon under the command of Admiral Don Juan de Lángara. 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.
The Battle of Trafalgar is the historical feat in which she participated and of which we have the best account. In spite of being dismasted by Admiral Nelson's artillery on 21 October 1805, she achieved glory in this battle under the command of the commander Don Cosme Damian Churruca and constituted for the Spaniards a handsome example of the heroism of their nation and the bravery of their sailors.
San Juan Nepomuceno was one of the last ships still fighting after most of the French ships had surrendered and most of the Spanish ships had either been captured or had yielded. The commander, Don Cosme Churruca, had previously ordered for the flag to be nailed to the highest mast. At the time, it was commonplace for ships to signal surrender by lowering their nation's flag. 'Nailing the flag' was a way to tell the enemy, allies, and indeed the ship's own crew and officers not to expect an easy surrender. As the hours passed Churruca, whose leg had been torn off by a cannonball, the deck of his ship covered by the blood of his wounded and dead seamen, continued to stubbornly order his ship's batteries to fire. 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, who continued the fight until he himself was killed. He was replaced by the next officer in command who also refused to surrender. However, unable to break the circle of fire formed by the six enemy ships, including Defiance, Tonnant and Dreadnought, and in order to prevent the ship from sinking with all the wounded trapped below, the last officer left alive in San Juan Nepomuceno yielded with over 400 dead and injured on board.
After Trafalgar, the ship was taken into British service and briefly renamed HMS Berwick before adopting the name HMS San Juan. 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. 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.
During the Peninsular War San Juan was fitted to act as flagship to a flotilla of gunboats based in Gibraltar. For this task she was re-rated as a sloop and placed under the command of Commander Thomas Vivion, who was the first flotilla commander, taking post in 1810. He was followed subsequently by Commander James Tillard who took command in 1812. There were a total of fourteen lieutenants under his command, each of whom took charge of one of the gunboats in the flotilla. As the gunboats had little capacity for accommodation, the lieutenants were assigned to, and lived aboard San Juan.
In later service San Juan acted as flagship to the admirals appointed as Commander-in-Chief Gibraltar. In 1813 she was flagship to Rear Admiral Samuel Hood Linzee with Captain John Fraser acting as flag captain. In 1814 she was flagship to Rear Admiral Charles Elphinstone Fleeming with Captain Gardiner Henry Guion acting as flag captain. 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. San Juan was finally paid off and sold at Gibraltar on 8 January 1816.