Spain is a democratic country, organized as a parliamentary government under a constitutional monarchy. In 1978, at the end of the dictatorship, a written constitution was adopted. Since then, Spain has been divided into 17 autonomous communities, each one having its own regional government. In 2010, the Spanish population was 47 million. Spain has been a member state of the European Union since 1986.