The Spanish language traces its history back to its roots in vulgar Latin, a variety of Latin that was influenced by indigenous languages of the Iberian Peninsula where it evolved. The Iberian Peninsula consists of modern day Portugal and Spain.
While the Iberian Peninsula was under Roman Rule in the 19 BC, its became known as Hispania by the Romans. The Iberians began to learn Latin from the Roman traders and settlers that came to trade and settle in the area. When the Roman’s classical Latin mixed with the indigenous languages of the Iberians, a language called Vulgar Latin emerged. Vulgar Latin was still very similar to classical Latin but added words from the indigenous languages of Iberian Peninsula.
Latin remained the official language of Hispania until around 711 AD when Arabic-Speaking Islamic groups from North Africa called ‘Moors’ conquered the region beginning from the southern peninsula. The Moors had almost entirely conquered the Iberian Peninsula by 718 AD when the Reconquista began.
The Reconquista (a Spanish and Portuguese word for Reconquest) was a period of 800 years in the middle ages that began in the immediate aftermath of the Moorish conquest of the Iberian Peninsula in 718 AD. The Reconquista was made up of several Christian Kingdoms originally from the Iberian Peninsula that succeeded in retaking (and repopulating) the peninsula from the Arabic-speaking Moors, concluding in 1492.
As the Reconquista moved from North to South, the Christian Kingdoms brought their Latin Dialects with them, including a particular variety that had originated in the north called Castilian. Castilian almost completely absorbed and replaced other provincial dialects as it was spread to southern and eastern regions. At the same time it borrowed hugely from Moorish Arabic and today there is an estimated 4000 arabic words in modern spanish.
The first step to standardizing modern Spanish based on the Castilian dialect, was in the 13th century by King Alfonso X of Castile. He assembled scribes at his court and supervised their writing, in Castilian. They wrote original works and also transcribed extensive works on history, astronomy, law and other fields of knowledge.
The Castilian dialect of Spanish gained wider acceptance during the reign of the Catholic monarchs Isabella of Castile and Ferdinand of Aragon, who completed the Reconquista of Spain in 1492 by pushing the Moors from their last stronghold in the southern city of Granada. Isabella and Ferdinand made Castilian the official dialect in their kingdom.
The same year the Moors were defeated in 1492, a Spanish scholar named Antonio de Nebrija wrote a a book entitled Gramática de la lengua castellana. It is credited with being the first ever book to study and attempt to define, the grammar and rules of any Romance language including Spanish.
The Spanish Royal Academy was founded in 1713, largely with the purpose of preserving the “purity” of the language. The Academy published its first dictionary in six volumes over a period from 1726–1739, and its first grammar in 1771, and it continues to produce new editions of both from time to time. Today, each of the Spanish-speaking countries has an analogous language academy, and an Association of Spanish Language Academies was created in 1951.