Portuguese is part of the Ibero-Romance group that evolved from several dialects of Vulgar Latin in the medieval Kingdom of Galicia, and has kept some Celtic phonology and lexicon. With approximately 215 to 220 million native speakers and 260 million total speakers, Portuguese is usually listed as the sixth most natively spoken language in the world, the third-most spoken European language in the world in terms of native speakers, and the most spoken language in the Southern Hemisphere. It is also the most spoken language in South America and the second-most spoken in Latin America after Spanish, and is an official language of the European Union, Mercosur, OAS, ECOWAS and the African Union.
When the Romans arrived at the Iberian Peninsula in 216 B.C., they brought the Latin language with them, from which all Romance languages descend. The language was spread by Roman soldiers, settlers, and merchants, who built Roman cities mostly near the settlements of previous Celtic or Celtiberian civilizations established long before the Roman arrivals.
Between 409 A.D. and 711 A.D., as the Roman Empire collapsed in Western Europe, the Iberian Peninsula was conquered by Germanic peoples of the Migration Period. The occupiers, mainly Suebi and Visigoths who originally spoke Germanic languages, quickly adopted late Roman culture and the Vulgar Latin dialects of the peninsula and over the next 300 years totally integrated into the local populations. After the Moorish invasion beginning in 711, Arabic became the administrative and common language in the conquered regions, but most of the remaining Christian population continued to speak a form of Romance commonly known as Mozarabic, which lasted three centuries longer in Spain.
Portuguese evolved from the medieval language, known today by linguists as Galician-Portuguese, Old Portuguese or Old Galician, of the northwestern medieval Kingdom of Galicia. It is in Latin administrative documents of the 9th century that written Galician-Portuguese words and phrases are first recorded. This phase is known as Proto-Portuguese, which lasted from the 9th century until the 12th-century independence of the County of Portugal from the Kingdom of León, by then reigning over Galicia.
In the first part of the Galician-Portuguese period (from the 12th to the 14th century), the language was increasingly used for documents and other written forms. For some time, it was the language of preference for lyric poetry in Christian Hispania, much as Occitan was the language of the poetry of the troubadours in France. Portugal became an independent kingdom in 1139, under King Afonso I of Portugal. In 1290, King Denis of Portugal created the first Portuguese university in Lisbon (the Estudos Gerais, which later moved to Coimbra) and decreed for Portuguese, then simply called the "common language", to be known as the Portuguese language and used officially.