Deal comes after 50 years of wrangling over the remote but strategically important archipelago