There was not much peace in Spain during the first part of the 20th century. Some Spaniards tried to set up a government chosen by the people (a democracy), and they made Alfonso XIII leave the country. However, in 1936, two different groups of Spaniards went to war over whether the government should be a democracy, in the Spanish Civil War (although those on the side of the Republic were largely socialist or anarchist), or take orders from one person. In 1939, those who wanted democracy were defeated, and a nationalist dictator named Francisco Franco took over the government.