John Sherlock (c. 1705 – 25 July 1794) was a Spanish brigadier general in the Ultonia Regiment. He successfully defended Melilla during a 100-day siege by Moroccan troops.
John was the son of Peter Sherlock, who had been made a baronet and knight by titular king, James III, the Old Pretender, in 1716. However, during the Irish Rebellion of 1641, the Sherlock family lost its extensive land holdings in County Waterford. Like many Catholic Irish, John emigrated to Spain with hopes of returning to Ireland once a Catholic was king of England again. And like his father and grandfather he served in the Ultonia Regiment (i.e. Ulster Regiment), part of the Irish Brigade of the Spanish Army.
John Sherlock fought in the Anglo-Spanish War of 1727–1729, a failed Spanish attempt to retake Gibraltar. He was made commander in chief of Melilla by Charles III of Spain. From 9 December 1774 to 19 March 1775, John Sherlock defended Melilla against troops of the sultan of Morocco, Mohammed ben Abdallah. When a Spanish fleet arrived with reinforcements, Sherlock broke the siege and routed the Moroccans. The entrance to the old town at Melilla includes a monument to "Juan Sherlocke." He was later made governor of Sanlúcar de Barrameda, where he died on 25 July 1794, at the age of 89.