The British occupied the island on and off until 1802 when it was finally handed back to Spain as part of the Amiens Treaty. During that time Menorca became an important part of Britain's security architecture in the Mediterranean Sea with a major naval base.