Portugal is a nation located on the Atlantic coast of the Iberian Peninsula, bordered on the east and north by Spain and on the west and south by the Atlantic Ocean. Inhabited by 500,000 BCE; distinct cultures began to emerge by the 6th millennium. BCE. Celts, later called Lusitanians, invaded in the 1st millennium BCE. It was ruled by Romans by the 2nd century BCE, then was occupied successively by the Germanic Suebi, the Visigoths in the 5th century CE, and the Moors by 711. It became a separate kingdom in the 12th century, and began expanding globally with colonies in South America, Africa, and the Far East from the 14th to the 17th centuries. From 1580 to 1640 it was ruled by Spain. In 1640 the House of Bragança reestablished a native Portuguese kingdom that lasted until 1910, though it suffered much turbulence, especially during the period of the Napoleonic wars. A republic was established in 1910, since when the nation has undergone rule by various dictators. A constitution and free elections were established in 1976. It joined the European Union in 1986.