It was reduced to 20,000 inhabitants in the 18th century. The population and economy started to increase again only in the early 20th century. The second half of the 19th century saw the arrival of railway transport via the opening of the Seville–Córdoba line on 2 June 1859.
Córdoba was connected by railway to Jerez and Cádiz in 1861 and, in 1866, following the link with Manzanares, with Madrid. The city was eventually connected to Málaga and Belmez.
On 18 July 1936, the military governor of the province, Colonel Ciriaco Cascajo, launched the Nationalist coup in the city, bombing the civil government and arresting the civil governor, Rodríguez de León; these actions ignited the Spanish Civil War.
Following the orders of the putschist General Queipo de Llano, he declared a state of war. The putschists were met by the resistance of the political and social representatives who had gathered in the civil government headquarters, and remained there until the Nationalist rifle fire and the presence of artillery broke their morale. When its defenders began fleeing the building, Rodríguez de León finally decided to surrender and was arrested.
In the following weeks, Queipo de Llano and Major Bruno Ibañez carried out a bloody repression in which 2,000 persons were executed.
The ensuing Francoist repression in wartime and in the immediate post-war period (1936–1951) is estimated to have led to around 9,579 killings in the province.
The Mosque-Cathedral was declared a UNESCO World Heritage Site in 1984, and in 1994 this status was extended to the entire historic centre of Córdoba. The city has a number of modern areas, including the district of Zoco and the area surrounding the railway station.