Spain has a long history of being a kingdom, dating back to the Middle Ages. The first kingdom of Spain was founded in the 8th century by Pelayo, a Visigothic nobleman who led a rebellion against the Muslim Moors who had conquered the Iberian Peninsula. Pelayo's kingdom was centered in the Asturias region of northern Spain, and it gradually expanded to include the rest of the peninsula.
The Kingdom of Spain reached its peak in the 16th and 17th centuries, when it was one of the most powerful countries in the world. During this time, Spain ruled over a vast empire that included territories in Europe, the Americas, and Africa. The Spanish Empire began to decline in the 18th century, and by the 19th century, Spain had lost most of its overseas possessions.
Despite its decline, Spain remained a monarchy. In the early 20th century, Spain experienced a period of political instability, including a civil war from 1936 to 1939. After the civil war, Spain was ruled by a dictatorship under General Francisco Franco. Franco died in 1975, and Spain transitioned to a democracy.
Today, Spain is a parliamentary monarchy, with King Felipe VI as head of state. The Spanish government is led by a prime minister, who is appointed by the king. Spain is a member of the European Union and the United Nations.