Humans have inhabited Portugal since Paleolithic times. Over the course of prehistory and history, various peoples have settled in the region, though the modern Portuguese trace their descent to the Lusitanians, a branch of the Iberian populations that spread over the peninsula in the third millennium B.C. Lusitanians made contact with Celtic peoples who moved into the region after 900 B.C. Roman armies invaded the Iberian Peninsula in 212 B.C. The Romans established important towns at the present-day sites of Braga, Porto, Beja, and Lisbon. An invasion of Swabians in the fifth century A.D. and of Moors in the eighth century A.D. added new elements to the Portuguese population, though Moorish Influence was much stronger in the south than in the north. Portugal emerged as an independent kingdom in 1140 with its capital in the northern city of Guimarães. As part of the reconquest, whereby the Moors were pushed out of the Peninsula, Lisbon was made the capital in 1298 and the boundaries of Portugal as they exist today were definitively determined. Early statehood and a national identity with deep historical roots are the basis of the relative homogeneity of Portuguese society. In the fifteenth century the Portuguese inaugurated their age of discovery and for three centuries built and expanded their empire. The loss of Brazil in 1822 and a series of economic and political crises led to a decline in the world position of the Portuguese during the nineteenth century. The monarchy was eliminated in 1910 with the establishment of the First Portuguese Republic, and this in turn was replaced by the authoritarian dictatorship of Antonio Salazar in 1926. Salazar formed his New State in 1932 on corporatist political principles. The Salazarist regime survived until 1974, when it was overthrown by a group of military men frustrated by the hopelessness of the colonial wars in Africa, wars that had escalated after 1961. The entire African colonial system was dismantled after 1974. In the late 1980s the Portuguese turned their attention toward Europe to become part of the European Community. However, linguistic and other cultural ties with former colonies, including Brazil, are maintained.