Spain's Capital City
The capital of Spain is Madrid. It is the country's largest city and its political, economic, and cultural heart, home to the Spanish government and the royal family. While the coastal city of Barcelona is also world-famous, it is Madrid that holds the role of capital.
A Capital in the Center
One striking thing about Madrid is its location. It sits almost exactly in the geographic center of Spain, high up on a plateau in the middle of the country. This central position is part of the reason it became the capital — placing the seat of government in the middle of the kingdom made it a natural hub. Madrid is also one of the highest capital cities in Europe because of the elevated plateau it stands on.
How Madrid Became the Capital
Madrid was not always the most important city in Spain. It rose to the role of capital in the sixteenth century, when a Spanish king chose to move the royal court there. Its central location made it easy to govern the whole country from one point. From that decision onward, Madrid grew steadily into the major European capital it is today, filled with grand squares, museums, and palaces.
Source
This article was written using information from Wikipedia.