The Berbers were the first settlers who have inhabited the territory of modern Morocco since the end of the 2nd millennium BC. Then Morocco was invaded first by the Vandals and then, in the 7th century, by the Arabs. By the 15th century Spain and Portugal took the effort to gain the control over the country, but the attempts fell pitifully flat. By the 16th century Morocco had become an important Sultanate that established diplomatic ties with other European states. Finally France became a protector of the greater part of the country. The French influence on the culture of Morocco is still evident. Morocco was granted independence in 1956 under King Mohamed V. The first constitutional referendum was held in December 1962, a year later - parliamentary elections.