Gibraltar was named for a general who led the Umayyad conquest of Hispania. It belonged to Spain between the years 1501 and 1704, and it was captured by a group of Dutch and British marines during the War of the Spanish Succession (1704). In 1713, Spain signed the "Treaty of Utrecht". This treaty ended the war and said Gibraltar would be British permanently. However, according to this treaty, if the Crown of Great Britain ever wants to leave the territory, the Crown of Spain will have a prior position in order to claim the sovereignty.