The Second Spanish Republic (19311939) was the second period in Spanish history in which the election of both the positions of Head of State and Head of government were in the hands of the people. (The First Spanish Republic was from 1873–1874.)

The Second Republic began on April 14, 1931 after the abdication of King Alfonso XIII, following local election in which Republican candidates won the urban vote. The first president was Niceto Alcalá Zamora (1931–1936). The Basques and the Catalans claimed independence but didn't immediately get the autonomy they wanted. The Straperlo scandal undermined the confidence in centrist republican parties and led to polarization.

The second president was Manuel Azaña (1936–1939). The Republic suffered a terrible crisis when General Franco attempted a coup on July 18, 1936, which was the start of the Spanish Civil War.

The Republic began to fall out of favor with some nations but received aid from others, such as Stalin's USSR. Azaña's government lasted until February, 1939. The Republic fell when General Franco and his troops took Madrid on April 1, 1939. A dictatorship (Franquismo) was established which lasted until Franco's death in 1975.