From This Is Hartlepool:
The monkey-hanging legend is the most famous story connected with Hartlepool. During the Napoleonic Wars a French ship was wrecked off the Hartlepool coast.
During the Napoleonic Wars there was a fear of a French invasion of Britain and much public concern about the possibility of French infiltrators and spies.
The fishermen of Hartlepool fearing an invasion kept a close watch on the French vessel as it struggled against the storm but when the vessel was severely battered and sunk they turned their attention to the wreckage washed ashore. Among the wreckage lay one wet and sorrowful looking survivor, the ship's pet monkey dressed to amuse in a military style uniform.
The fishermen apparently questioned the monkey and held a beach-based trial. Unfamiliar with what a Frenchman looked like they came to the conclusion that this monkey was a French spy and should be sentenced to death. The unfortunate creature was to die by hanging, with the mast of a fishing boat (a coble) providing a convenient gallows.