The history of Spain involves all the other peoples and nations within the Iberian peninsula formerly known as ''Hispania'', and includes still today the states of Andorra , Gibraltar , Portugal and Spain. It spans from prehistoric Iberia, through the rise and decline of a global empire, to the recent history of Spain as a member of the European Union. Modern humans entered the Iberian Peninsula about 32,000 years ago. Different populations and cultures followed over the millennia, including the Iberians, the Tartessians, Celts and Celtiberians, Phoenicians, Greeks, Carthaginians, Romans, Suebi and Visigoths. In 711, the Moors, a Berber and Arab army, invaded and conquered nearly the entire peninsula. During the next 750 years, independent Muslim states were established, and the entire area of Muslim control became known as Al-Andalus. Meanwhile the Christian kingdoms in the north began the long and slow recovery of the peninsula, a process called the Reconquista, which was concluded in 1492 with the fall of Granada.
The Kingdom of Spain was created in 1492 with the unification of the Kingdom of Castile and the Kingdom of Aragon. The first voyage of Christopher Columbus to the New World took place that same year, beginning the development of the Spanish Empire. The Inquisition was established and Jews and Muslims who refused to convert were expelled from the country.
For the next three centuries Spain was the most important colonial power in the world. It was the most powerful state in Europe and the foremost global power during the 16th century and the greater part of the 17th century. Spanish literature and fine arts, scholarship and philosophy flourished during this time. Spain established a vast empire in the Americas, stretching from California to Patagonia, and colonies in the western Pacific. Financed in part by the riches pouring in from its colonies, Spain became embroiled in the religiously charged wars and intrigues of Europe, including, for example, obtaining and losing possessions in today's Netherlands, Italy, France, and Germany, and engaging in wars with France, England, Sweden, and the Ottomans in the Mediterranean Sea and northern Africa. Spain's European wars, however, led to economic damage, and the latter part of the 17th century saw a gradual decline of power under an increasingly neglectful and inept Habsburg regime. The decline culminated in the War of Spanish Succession, which ended with the relegation of Spain from the position of a leading western power, to that of a secondary one, although it remained (with Russia) the leading colonial power.
The 18th century saw a new dynasty, the Bourbons, which directed considerable efforts towards the renewal of state institutions, with some success, finishing in a successful involvement in the American War of Independence. However, as the century ended, a reaction set in with the accession of a new monarch. The end of the eighteenth and the start of the 19th centuries saw turmoil unleashed throughout Europe by the French Revolutionary and Napoleonic Wars, which finally led to a French occupation of much of the continent, including Spain. This triggered a successful but devastating war of independence that shattered the country and created an opening for what would ultimately be the successful independence of Spain's mainland American colonies. Shattered by the war, Spain was destabilised as different political parties representing "liberal", "reactionary" and "moderate" groups throughout the remainder of the century fought for and won short-lived control without any being sufficiently strong to bring about lasting stability. Nationalist movements emerged in the last significant remnants of the old empire (Cuba and the Philippines) which led to a brief war with the United States and the loss of the remaining old colonies at the end of the century.
Following a period of growing political instability in the early 20th century, in 1936 Spain was plunged into a bloody civil war. The war ended in a nationalist dictatorship, led by Francisco Franco which controlled the Spanish government until 1975. Spain was officially neutral during World War II, although many Spanish volunteers fought on both sides. The post-war decades were relatively stable (with the notable exception of an armed independence movement in the Basque Country), and the country experienced rapid economic growth in the 1960s and early 1970s. The death of Franco in 1975 resulted in the return of the Bourbon monarchy headed by Prince Juan Carlos. While tensions remain (for example, with Muslim immigrants and in the Basque region), modern Spain has seen the development of a robust, modern democracy as a constitutional monarchy with popular King Juan Carlos, one of the fastest-growing standards of living in Europe, entry into the European Community, and the 1992 Summer Olympics.