The island was lost to the French in 1756 following the naval Battle of Menorca and the final Siege of Fort St Philip, which took place several miles from the town. After their defeat in the Seven Years' War, France returned the island to the British in 1763. In a joint Franco-Spanish effort and following a long five month invasion, the British surrendered the island again in 1782; It was transferred to Spain in 1783 as part of the Peace of Paris. The British recaptured the island in 1798, during the French Revolutionary Wars. The British and the French tried (and failed) to end hostilities between themselves with the Treaty of Amiens in 1802. Both nations agreed to cede or withdraw from certain territories, with the island of Menorca passing to the Spanish, with whom it has remained since.