Abstract
This study investigates the determining factors of railway expansion in nineteenth-century Spain, a period characterised by limited political interference in route planning but substantial public subsidies for construction. For the analysis, we developed a new dataset on municipal railway access from 1848 to 1910 and used Cox regression to assess the key factors influencing network development. The results show that economic criteria prevailed until 1877. From then on, the focus shifted to political and administrative interests, but without abandoning the economic interest. This finding nuances the interpretation of railway expansion in Spain as primarily driven by political and nation-building goals, showing instead a dynamic interaction between economic and administrative priorities over time.
Keywords
Introduction
The spatial allocation of investment in infrastructure is among the most prominent challenges in the planning and development of transportation networks. This type of decision often depends on a fundamental trade-off between efficiency and equity. 1 Efficiency-oriented policies prioritise investment in regions with high income and marginal productivity, aiming to maximise economic returns. In contrast, equity-focussed policies target lagging areas to reduce interregional and social disparities, improve access to basic services, and promote new economic opportunities. Undoubtedly, beyond economic considerations, other factors can also shape network expansion, including strategic defence needs, 2 the pursuit of cultural uniformity 3 and the extension of central administrative control. 4
In the nineteenth century, the expansion of railways in the United Kingdom was driven by economic and commercial interests, as a rapidly growing population and urbanisation revealed the limitations of existing transport technologies, such as canals and animal-drawn carts. The first long-distance line, the Liverpool and Manchester Railway, opened in 1830, linking two major trading centres and facilitating the movement of people and staples such as cotton and coal. This success fuelled rapid growth across the United Kingdom as private companies recognised the profit potential of this new technology. In the 1830s, several companies began building lines to connect major cities with ports and navigable canals. 5 These early successes inspired many local companies to build further lines based on commercial interests and profit motives, with a very limited role for the state. 6
In contrast to the United Kingdom, Sweden's rail network was built mainly under state control, with a strategic focus on major trunk lines connecting Stockholm with Norway and major cities in the west and south, following the shortest routes to ensure efficiency and minimise construction costs. However, the planning process went beyond mere connectivity. Military considerations strongly influenced the routes, with lines being routed inland to reduce vulnerability to invasion. The state also sought to minimise competition with existing transport infrastructure, such as canals and other established routes, and to avoid overlap with alternative modes of transport. As a result, the main lines crossed many rural, previously isolated regions – not by chance, but as part of a broader vision. As Heckscher notes, Ericson, a key figure in this effort, saw the railways as a tool to “stimulate economic development in those parts of the country which, through the absence of communications, had been left behind”. 7 Thus, while military security was a primary motive, railway policy also aimed to integrate and uplift underdeveloped areas, balancing strategic imperatives with economic progress in those regions.
The French and Portuguese cases are also of particular interest because, as in Spain, private initiative and local investors proved incapable of developing a national-scale network. Recognising the need to create a national network, the French state assumed responsibility for planning the railway network in the 1830s, culminating in the adoption of the first railway law in 1842. A key feature of this law was the introduction of a subsidy system that guaranteed investors a minimum return of 4 to 5 per cent on their capital. 8 This legislation also laid the foundation for the French system, connecting Paris to the main regions, adopting the star design proposed by Alexis Legrand in 1838. 9 The subsidy system it introduced reflects the dual nature of the factors driving railway expansion in France: economic incentives encouraged private investment, while state planning ensured the network's alignment with broader administrative and nation-building goals. Rather than being contradictory, these motivations were complementary, as linking Paris to the rest of the country was both an economic necessity and a logical step in strengthening national cohesion. This mixed model proved highly effective. By the mid-1850s, France had constructed approximately 5,000 km of new railway lines, connecting the capital to other vital economic, administrative and strategic centres. 10
In a similar way, the Portuguese state played an important, though less centralised and systematic, role in planning its railway network, albeit later than France. 11 After failed initiatives in the 1840s, a coherent strategy emerged in the early 1850s, combining state planning with economic incentives to attract private capital. The network was designed with an international outlook: Portugal adopted the Iberian gauge (1,668 mm) and prioritised linking Lisbon to the Spanish system and other key regions such as Porto through three main lines 12 – to Elvas on the border, to the Douro in the north, and to Beja in the south. 13 By 1864, Portugal had established a basic network of nearly 700 km, integrating its most developed regions and securing its first cross-border connection. 14
In Spain, railway development was initially based on private initiative, with the first lines focusing on local connections. However, this approach quickly revealed insufficient to provide the means for the construction of long-distance lines linking key nodes. To overcome this limitation, the Liberal government introduced a model of public-private cooperation that borrowed heavily from the French railway law of 1842. This framework was formalised by the Railway Act of 1855, which offered private companies 99-year concessions to build and operate railway lines, often with subsidies per kilometre of track built. Regarding the morphology of the network, it established that priority was to be given to connections between Madrid and the ports and the frontiers, which meant that the lines that followed these directions were given marginal administrative facilities. However, these were very general guidelines, and the Liberal government did little to intervene in the design of the railway network. 15 In fact, subsidies could and were given to companies building transversal, mining and many other lines. In other words, the discriminatory nature of the 1855 law was practically nil. Although the railway companies received substantial public subsidies – some of the largest in Western Europe – and some guidelines for network design, they also enjoyed a large degree of freedom in the routing of their lines.
This context has stimulated research into the factors driving the expansion of Spain's railway network in the nineteenth century. Some scholars argue that political objectives 16 and state-building efforts 17 played a central role in shaping the network's design, while others highlight its inefficiency. Nadal underscores the dominance of an extractive, outward-oriented model, as opposed to one aimed at fostering internal economic integration. 18 Similarly, Broder contends that the network was poorly aligned with the country's economic needs, ultimately increasing the cost of connecting production and consumption centres. 19 Another perspective suggests that the network was built primarily to meet the country's most pressing transport needs, implying that economic factors were dominant. This view is supported by simulation-based analyses, which indicate that much of the actual network coincided with routes that were predicted based on population size, GDP and distance alone. For instance, Equipo Urbano and, more recently, Martí-Romero and others use gravity-type models to show that the Spanish railway's initial configuration broadly matched patterns of economic interaction and regional accessibility, implying an underlying economic rational in its layout despite political centralisation. 20 Regional studies also tend to emphasise economic considerations as the key determinant of line placement. 21 Esteban-Oliver and Martí-Henneberg have suggested that the business strategies of railway companies also played a crucial role in shaping the sequence of expansion. 22 However, these works frequently focus on regional perspectives or evaluate the appropriateness of railway connections using a broad territorial scope, often discounting the local characteristics of the areas that railways connected. This gap, coupled with limitations in data availability and methodological approaches, has impeded the formulation of broader, generalisable conclusions regarding the explanatory factors of network expansion in Spain.
This article addresses this issue by examining the relevance of factors commonly recognised in the literature as crucial to Spain's railway expansion, including economic drivers – such as population, existing traffic flows and construction costs – as well as political and administrative factors, in particular a municipality's status as a provincial or district capital, in the likelihood of a station opening in a municipality during the period 1848–1910. This analysis is particularly relevant given the historically poor performance of Spain's railway sector in the nineteenth century, which is often cited as an obstacle to the country's modern economic development. 23 While our approach cannot fully explain the reasons for this underperformance, it can nuance the widely held hypothesis that political factors such as nation-building predominated over the country's immediate economic needs.
To assess this, we used as our main empirical approach a survival analysis framework, specifically the Cox proportional hazards model. Importantly, this estimation technique offers a significant advantage in that it not only assesses whether a municipality gained access to the railway but also considering the time it took for the railway to reach it. Furthermore, the model considers all observations, including those where the railway never arrived, ensuring a robust and comprehensive analysis that utilises the full dataset. To implement this approach, we created a new dataset, compiling new information on the year of railway arrival for all 8,985 municipalities that existed in peninsular Spain from the opening of the first railway in 1848 to the near completion of the network in 1910. We have also integrated into this dataset the variables – previously introduced – that are usually recognised as critical to understanding Spanish railway expansion.
After this introduction, the article consists of the following sections. In the next section we explain the legislative process and the territorial development of Spanish railway construction and some of its implications. The third reviews the data. The fourth section explains and develops the methodology. The fifth section presents the results. The sixth is a discussion of the results. The article ends with some conclusions.
Historical background
In Spain, the first attempts to build a railway were made in the 1830s, driven by the need to meet local transport needs. However, progress lagged behind other European nations due to persistent economic and financial constraints. The first operational line, between Barcelona and Mataró, was not completed until 1848, a milestone that marked the beginning of the railway era in Spain, but also exposed difficulties, particularly in raising sufficient capital – a challenge already recognised by contemporaries (in November 1845 the civil engineer Ramón de Echevarría published a series of articles in which he voiced doubts as to whether the promoters of the proposed lines would be able to raise sufficient capital for their construction). 24 Aware of these problems and inspired by the more decisive state-led models observed in countries such as France, the Spanish government took a more proactive role in a process that culminated in the approval of the Railway Law of 1855.
This law had a significant impact on network development, mainly through its financial incentives. Although it proposed several aid systems, in practice only direct subsidies were implemented, with the state allocating fixed amounts per kilometre of track built for most long-distance lines through an auction system. This financial support triggered rapid growth: between 1855 and 1866, 4,756 km of new track were added, rising to 6,300 km by 1876 (Figure 1). During this period, often referred to as the First Wave of network expansion, 25 the network took on a tree-shaped design with Madrid at its centre. Major cities such as Barcelona (completed in 1862), Valencia (1856) and Seville (1860) were connected to the capital, as were border crossings with France at Irun (1864) and Portugal at Badajoz (1863), and important ports such as Alicante (1858) and Cádiz (1861). At the same time, regional networks emerged in Catalonia, the Basque Country and Andalusia, while lines serving the mining areas of Asturias, León and Huelva also developed (Figure 2). 26 Interestingly, some scholars have argued that this initial layout of the Spanish railway network, centred on Madrid, was firstly economically inefficient 27 and secondly justified only for political reasons. 28 Nevertheless, given the almost island-like geography of Spain and the central location of Madrid, a centralised (or radial) design was probably the most logical option, 29 serving both economic and administrative objectives, as was common elsewhere. 30

Cumulative number of km of Iberian-gauge lines in Spain by year, 1848–1910.

The territorial expansion of the Spanish railway network, 1848–1910.
Despite its successes, the 1855 law contained significant technical and organisational flaws. For the wrong technical reasons, it required a track gauge different from the common European standard, which made cross-border connections difficult. 31 Although cooperation agreements with Portugal and France for the construction of international lines were reached relatively easily, the signing of similar agreements for the extension of lines through the Pyrenees was delayed until 1885, and the first of these lines did not open until 1922. In the military sphere, a specific law on strategic railways was not passed until 1909. 32 In general, government initiatives to promote railways for specific purposes, such as military or cross-border connections, were limited and only materialised after much of the main network had already been built.
Moreover, several provinces were not connected to the network, and the number of cross-connections, branches and auxiliary lines were limited. These problems, together with the poor performance of many companies, led to calls for a change in the regulatory framework. After several technical reports in the late 1860s, the government approved a new national railway plan in 1870, but it was hardly implemented due to political events such as the Carlist War. A new plan was approved in 1877. Like the 1855 law, the 1877 law did not set any deadlines or priorities, leaving the railway companies free to choose which lines to build, to delay their construction or not to build them at all. However, the proposal to build many lines and to maintain or increase public subsidies was an invitation to the railway companies to extend the network to places where its economic viability was doubtful. The technical studies that preceded the railway plan that accompanied the 1877 law explicitly stated that all provincial capitals and most of the judicial district capitals should be connected to the railway. 33
During the Second Wave, the network almost doubled in size. New main lines were built to integrate regions such as Galicia and eastern Andalusia, linking all previously isolated provincial capitals and improving transit with direct routes such as Madrid-Lisbon. In addition, transversal lines such as Alicante-Granada and Huelva-Zamora were developed to strengthen the interconnectivity of the network. The new railways were extended to form a centralised, tree-shaped network with several connecting lines. However, the construction of some cross-country lines and access to the less populated and more remote provincial capitals was postponed. The first important interurban line, Valladolid-Zaragoza, was not inaugurated until 1895. The cities of Soria, Almería and Teruel did not have railway stations until 1892, 1895 and 1901 respectively (Figure 2). As time went on, the country developed slowly and the railway sector matured, which increased the interest of railway companies in these cities as markets. The expansion process continued until the first decade of the twentieth century, by which time the construction of Spain's core railway network was largely complete.
The expansion of the first wave of railway lines in Spain was influenced by a range of factors, as documented in the literature. Artola suggests that these lines often followed the layout of main roads, which traversed densely populated valleys and sought the easiest mountain passes. 34 These roads, frequently connecting to ports, offered lower transport costs due to better construction parameters, regular maintenance, rest areas, and return traffic. 35 Some studies also point to the importance of linking Madrid with a south-eastern port to enhance foreign trade. 36 Additionally, some scholars have argued that urban population distribution may have influenced railway expansion, as the network appeared to prioritise connections between major population hubs 37 – an outcome often interpreted as aligning with the political objectives of the liberal regime. However, the fact that many provincial capitals in the centre and south of the country, as well as towns with administrative relevance but little economic activity, were not granted railway connections suggests that economic considerations often outweighed political priorities, though the two were not mutually exclusive and likely interacted with each other. 38 Furthermore, while the state administration followed a hierarchical structure – from Madrid to provincial capitals and then to judicial district capitals – this political logic did not consistently translate into railway investment. 39 However, for the second wave (1877–1901), the literature emphasises the growing importance of political and administrative objectives, particularly the goal of connecting all provincial and district capitals in order to strengthen territorial cohesion. 40 Some authors also interpret this phase as the natural progression of the network, as the most economically profitable routes had already been built during the first wave. Subsequent expansion inevitably extended the railway to less accessible and less populated areas, with diminishing economic returns. 41 Even so, as noted in the Introduction, these factors have not been systematically and quantitatively assessed.
Data
The construction of the liberal state in the early nineteenth century provided Spain with the necessary tools to collect reliable and updated statistical information. The first census in modern Spain was carried out in 1855, the same year as the passsing of the General Railway Law. However, some problems with the census made it advisable to use that carried out five years later, about which there are no major objections. 42 In the 1860 census, as in those that followed, the smallest unit of analysis was the municipality. 43 Consequently, this will be the territorial unit of analysis in this article.
Specifically, we use the ESPOP database, 44 which covers all 9,130 homogeneous municipalities that existed in the country from 1860 to 1930, including centroids and population sizes for the years 1860, 1877, 1887, 1900, 1910, 1920 and 1930. In this study, however, we have only used the population data for 1860 and 1877. Furthermore, have also limited our analysis to peninsular Spain, reducing the sample to 8,985 observations.
Railway access
It is possible to assess railway accessibility in various ways. In this article, we focus on two key dimensions: access at specific points in time (1877 and 1910) and time since the arrival of the railway, measured as the number of years a municipality had access to the railway network prior to these reference years. As we will discuss in the methodological section, this approach allows us to consider not only whether a municipality gained access to the railway, but also the timing of this access, providing a more nuanced understanding of the factors that determined it.
In the context of this article, we created both variables using the Esteban-Oliver and Martí-Henneberg database, 45 which provides information on the location of each station and its opening and closing dates for the period 1848 to 2023. To create the access to the network variable, we used the ESPOP urban centres and two GIS layers containing the stations that were in operation in 1877 and 1910 respectively. Following Esteban-Oliver, we used the Buffer tool in QGIS 3.24 to create a 5 km buffer zone around the centroid of each of the 8,985 municipalities in the ESPOP dataset. This buffer zone approximates a one-hour walking distance and provides a more meaningful historical measure of access than administrative containment alone. Then, we overlayed the buffer zone with the 1877 and 1910 station layers and used the QGIS Extract by Location tool to determine if a station existed within this buffer area in any of these years. We considered that a municipality would have access to the network if this condition was met. Note that a municipality may have access to the network for the years 1877 and 1910, for 1910, or no access at all. This is because there were no station closures during this period.
To create the time since arrival of railway variable, we simply subtracted the year the station opened from our censoring years, 1877 and 1910. For instance, Mataró received access to the railway in 1848. Consequently, its exposure variables will be of 29 and 62 years for 1877 and 1910, respectively. Note that, if a municipality had more than one station within its threshold, we subtracted the value of the station with the earliest opening date. Figure 3 shows the territorial distribution of this variable using 1910 as the censoring year.

Years with railway access for Spanish municipalities, 1848–1910.
Other variables
From a territorial point of view, in nineteenth-century Spain there were two other administrative levels in addition to the municipalities: provinces and partidos judiciales (judicial districts). The reorganisation of the provinces was one of the first decisions taken by the new liberal regime that came to power after the death of the absolutist King Ferdinand VII in 1833. The 49 new provinces had greater administrative competences and were usually governed from their most important city. A year later, in 1834, the districts were created as part of an effort to modernise and centralise the country's administration. Each district encompassed several municipalities within a province and was governed from a town, which housed a court of first instance responsible for dealing with local legal matters. The capital status of a district indicated a limited administrative role, primarily judicial rather than economic. 46 Information on whether a municipality was a district capital and/or provincial capital was obtained from the 1860 census. The province to which each municipality belonged was obtained from ESPOP.
We also used ESPOP centroid data and QGIS tool Distance Matrix to create a variable representing the distance from each municipality to the provincial capitals. Similarly, we used this tool to create a database with the distances from each municipality to Madrid, Barcelona and the Puertos de Primer y Segundo Orden (First- and Second-Class Ports, onwards referred as main ports) as defined by the Ley General de Puertos of 1880 (General Port Law), main roads (usually paved) and navigable waterways. 47 Regarding the variables related to the physical geography of the municipalities, we first calculated the altitude above sea level of each municipality. To do so, we overlayed the ESPOP municipal centroid database and the Copernicus Land Monitoring System elevation raster (20 m×20 m) of Spain and used QGIS Point Sampling Tool to calculate the exact altitude of each municipal centroid. We also used this raster and QGIS Zonal Statistics command to calculate the average slope of the municipality. Note that this variable was calculated using the IGN-2018 enclosure map after several adjustments to fit the municipal structure from 1860 to 1930.
Finally, we incorporate the occupational structure for the year 1860, sourced from Esteban-Oliver, 48 although this data was only available at the district level. Military variables were excluded due to their minimal impact on the construction of the railway network. Their influence was mainly limited to recommendations – outlined in the 1852 Reglamento de Plazas para el Cuerpo del Estado Mayor (Regulation of Places for the General Staff Corps) – that lines passed near barracks, which were typically located in provincial capitals. To avoid multicollinearity, and because the provincial capital variable adequately captures the effect of military barracks, these factors were omitted from the model. Table 1 presents the summary statistics of these variables.
Summary statistics of the variables.
Notes: Distances are always expressed in metres; number of observations: 8,985. Although the railway continued expanding until the 1960s, the “Opening year of a station” variable includes only values up to the year 1910. Specifically, of these 8,985 municipalities, 1,826 received access to the railway during our period of study.
Methodology and empirics
Given the nature of our analysis – where the time to the event, specifically the arrival of the railway in a municipality, is a critical factor, but a significant proportion of the municipalities never received railway access – we use a survival analysis framework. This approach allows us to model the time to the event while treating the sample appropriately, as it includes all observations regardless of whether the event occurred.
49
To implement this, we use the Cox proportional hazards model as follows:
Where
In this model, we included several variables that the literature usually suggests are likely to be correlated with the likelihood of receiving railway access. First, we included the natural logarithm of municipal population size in 1860 and 1877 as a proxy for the socioeconomic relevance of a municipality during each pre-wave period. Although most of the constructions of the first wave began after 1855, we utilised the 1860 census data as our variable due to the lack of reliable census data prior to this date. This is a cause for concern, as it could introduce an amplification bias. Railways might have already been fostering population growth in municipalities that gained access to the network before 1860. 50 However, given that internal migrations were low during the central decades of the century, 51 this impact should have been very limited. Moreover, by 1860, most of the first wave of railways was still under construction, meaning local displacement effects were likely not yet very significant. In fact, only about 1,000 km of railway lines were in operation before the late 1850s. Consequently, we believe it is reasonable to assume that the municipal population structure of the early 1850s closely resembled that of 1860. Nevertheless, and as a robustness check, Table A.1 in the Appendix presents the model estimated using only municipalities that gained railway access after the year 1860. The results, and particularly the population coefficient, remain largely consistent with the main findings (see Results section), suggesting that this issue does not compromise the reliability of the overall exercise.
Second, binary variables have been included to identify whether a municipality was a provincial capital and/or a district capital. This variable is significant in that it allows us to examine the role of the Spanish Liberal State in developing the railway network for political reasons. 52 Importantly, as previously mentioned, provincial capitals served as anchoring points for the railway network. Consequently, municipalities situated near these capitals may have received railway access earlier due to their geographical advantage. To capture this effect, we included the natural logarithm of the distance to the nearest provincial capital as an additional covariate.
Third, the analysis included the mean ruggedness of each municipality surface area, as well as a dummy variable that equalled 1 if the municipal centroid was situated at an altitude of over 1,000 metres. This approach allows us to highlight the significance of construction costs in the context of network expansion.
We also introduced a set of variables that capture municipal accessibility to pre-industrial transportation networks. The proximity to these networks may be a significant factor in determining railway access, as they reflected the principal transport flows prior to the construction of the railways. These included the natural logarithm of the distance to the nearest navigable river or canal – despite its limited impact on Spanish transport during the nineteenth century 53 – and to the main roads in 1847 and 1877. Additionally, a binary variable was included for municipalities located within a radius of less than 5 km to a main port. We have discarded the inclusion of third category ports because of their minor significance.
Finally, we included two additional variables as stratified factors: the province of each municipality and a binary indicator identifying whether a municipality is a provincial capital. The province variable was stratified because it was as an ancillary covariate that strongly influences the sequence of railway expansion yet demonstrates non-proportional effects over time. Specifically, when a municipality within a province gains railway access, the probability of subsequent access for other municipalities in the same province increases. This pattern is driven by a combination of economic, logistical, political, and social factors. For instance, the establishment of railway infrastructure in one municipality often indicates an ongoing expansion within the province, thereby elevating the likelihood of connectivity extending to additional municipalities in the region. The provincial capital status was included as a stratified variable for a similar reason. It is of little interest in our analysis, as its prioritisation is evident due to its relevance across multiple dimensions, including economic, political, and administrative considerations, yet it demonstrates a non-proportional effect. In sum, by stratifying these variables, we can account for their confounding influence without assuming proportional hazards, thereby reducing bias in the estimated coefficients of the primary covariates.
Proportional hazards risks assumption
In a Cox hazards model, one of the key premises is the proportional hazards (PH) assumption. This assumption posits that the effects of variables on the hazard function are constant over time and additive on a specific scale. In other words, the effect of a variable on the hazard rate is multiplicative and does not change over time. Violation of the proportional hazards assumption may have significant implications for the validity and interpretation of the results. For this reason, the model was subsequently tested for compliance with the proportional hazard assumption using formal tests based on scaled Schoenfeld residuals. Table A.2 of the Appendix shows that it did not fully satisfy this assumption, mainly because of the population size variable.
The non-proportionality of population size is historically justified, as connecting large cities would have been a high priority. However, once these key points were linked, the importance of population size would have diminished considerably. Nevertheless, violating the proportional hazards (PH) assumption does not undermine the model's findings for this variable. Instead, the estimated coefficient for population size should be interpreted as an average effect across the study period, rather than a constant effect at all-time points.
Also, note that the violation of the proportional hazard assumption is consistent with the changes in the legal framework. As we have seen, the Law of 1877 could be a turning point for the factors that explain network expansion in Spain. Then, dividing the analysis in two differentiated waves can also help us control for this issue.
Results
This section examines how our variables of interest relate to rail access in Spain. The main source of evidence for the findings is the Cox regression analysis. We have also included some maps that were produced using GIS to help with visualisation and facilitate the analysis. However, before proceeding, it is crucial to clarify the interpretation of the model's coefficients. The significance of the coefficient of a variable reflects the economic (or other) interest of each municipality for the companies, but not necessarily the good design of the railway network. From their point of view, not all large cities had to be attractive markets for transport (at least not in 1855), nor was their size the only variable that made them attractive. Moreover, the rail connection between two cities might not be optimal, regardless of whether it followed the former road or not. The only information captured by these coefficients is the probability that the local circumstances of each town would increase the chance of a railway passing through it.
On the other hand, it is also important to note that the political-administrative relevance of a variable can be subsumed in its economic relevance. Madrid, as the national capital, was relevant in all senses, but it is difficult to identify the economic relevance of some provincial or district capitals. The challenge is to identify these ambiguous cases.
Table 2 shows the results for the whole period and the two waves into which we have divided it. Column 1 corresponds to the whole period, 1848–1910, and columns 2 and 3 correspond to the sub-periods 1848–1876 and 1877–1910. The table shows the HR (hazard rates) of each variable. As the coefficient of each non-binary variable is the natural logarithm of the hazard rate, the interpretation of the table is that an HR > 1 indicates a positive effect of the exogenous variable on the independent variable; and an HR < 1 indicates a negative effect. When the variable is dichotomous (such as being the capital of a judicial district), the HR indicates the change in probability when the event is present compared to when it is not.
Cox regression estimates of railway access for Spanish municipalities, 1848–1910.
Notes: Stratified variables: provincial capital binary and provincial dummy. Note that there are 8,938 observations compared to the 8,985 included in the full sample. This is because the 47 provincial capitals in Peninsular Spain are stratified and, thus, not accounted for as observations, as explained in the previous section.
Significance at the 10% level.
Significance at the 5% level.
Significance at the 1% level.
The overall results in column 1 (1848–1910) show that our main explanatory factors for economic development – population size, access to a port and distances to main roads, Barcelona and provincial capitals – were highly significant in explaining access to the railway. Administrative and political factors also seem to have been important, as being a district capital or the distance to Madrid are significant. Finally, being above 1,000 metres and average ruggedness are also significant, meaning that areas with geographically difficult terrain were less likely to have access to the network. These results remained robust to different specifications of the model and to different estimation techniques – a probit model and a two-stage Heckman selection model – which we detail in Tables A.3 and A.4 in the appendix. However, as noted above, this overview may mask some significant shifts in network access priorities that may be associated with the Railway Acts of 1855 and 1877 and subsequent waves of railway expansion.
Regarding the first wave of expansion (1848–1876), column 2 shows that population size in 1860 has a positive, significant effect (HR of 1.210, p < 0.01). This means that a 50 per cent increase in population is associated with an 8.1 per cent increase in the probability of receiving a railway connection. Given the close correlation between population size and economic development, this variable is likely to indicate that potential demand for both passenger and freight transport was a crucial factor during the first wave. The kernel population density map (Figure 4) supports this interpretation, showing that the railway corridors focused on linking the most densely populated areas, indicating that companies prioritised places with higher expected demand. Indeed, other key indicators of the intensity of economic activity and flows of goods and people, such as distance to Barcelona, have coefficients that are consistent with it. Distance to Madrid can also be linked to economic motivations, as it served as the central hub of the network due to its strategic location and high demand for agricultural products from nearby regions and industrial goods from peripheral areas.

Estimated Population Density in 1877 and the Iberian-gauge railway network (1848–1910).
Distance to pre-existing infrastructure and transport flows also played a key role. The negative and significant coefficient for the distance to main roads suggests that areas better connected prior to the railway age were more likely to receive a connection. Similarly, although access to main ports narrowly misses conventional levels of statistical significance – likely due to the small number of such cases in the sample – the magnitude of the coefficient (HR = 1.511) indicates that reaching these nodes was a high priority for railway development.
The binary indicator for district capital is not significant. As mentioned above, this variable should be interpreted as an administrative and political factor. Conversely, the distance to the provincial capital has a significant and negative effect, i.e., the greater the distance to the capital, the less likely it is to be connected by rail. Thus, their economic influence made provincial capitals and their surrounding areas particularly attractive for railway development. However, it is also important to consider that this variable can also be explained by the fact that provincial capitals were the anchors of the network, and thus municipalities surrounding these cities may have had a higher chance of receiving railways just because of their geographical location.
Importantly, these results remain robust even when we exclude municipalities that received railway access before 1855 or 1860 and focus only on the lines affected by the General Railway Law of 1855 (see Table A.1, columns 2 and 3).
Column 3 shows that for the second wave (1877–1910) economic factors seem to be less important. As explained in the historical background section, these results are in line with the principles laid down by the successive commissions of experts that influenced the General Law of 1877, which prioritised the connection of all provincial capitals and as many judicial districts as possible. Thus, the population size has a positive but not significant relationship (1.090, p > 0.1). The HR of the variable district capital is also positive, but now significant (1.485, p < 0.01). This means that municipalities that are the capital of judicial districts have a 48.5 per cent higher probability of receiving access, suggesting that unlike in the first wave, administrative centres were anchor points for the railway network. This finding, together with the negative and significant results for distance to the nearest provincial capital or to Barcelona, suggests that in this wave economic factors have lost importance in favour of administrative ones, reflecting a shift in their relative importance. Although distance to Madrid retains its positive and significant effect in the second wave, we believe that this effect may be partly explained by its central geographical location, which limits the range of distances to other cities. This interpretation is also supported by the kernel density map (Figure 4), which shows that many of the lines built after 1877 extended into sparsely populated areas. This suggests that the second wave was driven more by the goal of closing gaps in the network and connecting previously isolated regions than by immediate economic demand.
Another factor that points in this direction is the results for adverse geographic conditions, ruggedness and altitude, which significantly reduced their importance in the second wave, when the railway reached areas with higher average ruggedness, such as Teruel, Almería, and Jaén (Figure 5). We think there are two main causes for this. First, construction in difficult terrain became cheaper during the period, in line with advances in railway technology. This increased the incentive to extend the network into geographically difficult areas. Second, the first wave focussed mainly on connecting municipalities located along the natural pathways of the Iberian Peninsula, namely the river valleys that cross Spain from east to west. These places used to have more dynamic economies and better connections with the rest of the country, making them more attractive for railway construction. However, the General Law of 1877 encouraged the development of some new lines outside the traditional transport corridors. These lines had higher construction costs and lower expected returns and required greater public subsidies to be completed. As a result, the sparsest provinces began to converge in terms of infrastructure provision, indicating a gradual shift towards more balanced territorial coverage. 54

Average terrain ruggedness (300 × 300 m grid) overlaid with the Iberian-gauge railway network (1848–1910).
In addition to the above, and recognising the limitations of our socioeconomic indicators, we have also explored how the occupational structure relates with the probability of receiving railway access (Table A.5 of the Appendix). Sadly, this data was only available at the district level, which implies a much smaller sample. This may mean that the estimates are not as precise and should be interpreted with caution. In this model, the results show that the population employed in industrial activities has a positive and significant HR in the first wave, but it loses significance in the second. On the contrary, the HR of population engaged in primary activities is not significant in the first wave but shows a positive and significant effect in the second. This may be partly because the data on the occupational structure only refer to the year 1860 (data for 1877 are not available). Although there were no major changes in the territorial distribution of industry and agriculture in Spain between 1860 and 1877, the non-optimal quality of the data could distort the sample and bias the results. 55 In any case, the shift from industrial to agricultural preference is evident.
Finally, as an additional robustness check, Table A.6 in the Appendix presents the results of estimating Equation 1 after excluding all municipalities that had fewer than 5,000 inhabitants in the year 1860. The purpose of this exclusion is to control for the possibility that smaller municipalities were inconsequential and thus may have received railway access by mere chance. By focusing on larger municipalities, we ensure that our overall results are not merely a product of random variation. The results remain consistent with those in Table 2, revealing an underlying economic rationale.
Discussion
Our model shows that the first wave of construction appears to have followed an economic rationale. This is further supported by territorial patterns: regions with the highest GDP per capita in 1860 – such as Madrid, Catalonia, the Basque Country, and Navarra – also had the highest railway densities by 1870. Conversely, the poorest regions, including Galicia, Extremadura, Asturias, and Castilla y León, were among the least connected. 56
The small-scale layout of the railways prioritised connecting the most attractive markets – municipalities with the most dynamic economies and largest populations – while keeping construction costs low. Railway lines mostly followed traditional transport routes in river valleys, avoiding steep gradients and reducing the need for expensive bridges and tunnels. There is therefore no reason to believe that political factors such as nation-building took precedence over economic considerations. Rather, our findings suggest that economic priorities were the main driver during the first wave, while political and administrative objectives coexisted alongside, becoming more prominent in later stages.
In addition, our results for the second wave suggest the existence of an expansion strategy, partly guided by criteria of territorial equity and the need to establish a broader and deeper public administration. 57 However, the underlying motives for these decisions remain an open question. Could this expansion to the periphery be attributed to a stronger and more consolidated state? Our model cannot confirm or reject this hypothesis, nor can it exclude the possibility that local political interests played a role in shaping the growth of the network after 1877. These questions highlight the need for further investigation, perhaps using quantitative methods like those used in recent studies of infrastructure development. 58
These results contribute to the general study of the expansion of transport networks. First, our model shows that economic factors outweighed political and administrative considerations or concerns about territorial equality in nineteenth-century Spain, while political and administrative considerations may have also influenced decisions, but mainly after 1877. Specifically, railway access followed a pattern like the four-stage development of German railways described by Heinze and Kill. 59 There, development began with isolated, privately built local lines (often in mining regions where water transport was impractical and coal was abundant), followed by demand-driven urban links with increasing state involvement, then expansion into rural areas to ensure equitable access, and finally consolidation of the network through efficiency improvements and modernisation. This pattern may also apply to France and many other European countries in the nineteenth century. The importance of the Spanish case lies in the observation that the limited capacity of the state to direct railway construction did not lead to substantially different outcomes. Thus, this sequence of development is likely to be common to a wide range of nations, regardless of the specific model of railway construction adopted in the nineteenth century; a consistency that probably occurs because it reflects a logical progression in the prioritisation of transport network development.
This work also advances the understanding of the expansion of the Spanish railway network. Specifically, using a new fine-grained spatial dataset and robust estimation techniques, we show that, at the local level, economic factors were main drivers of this development. The model also showed that political-administrative variables were not deciding factors, at least until 1877. 60 This new body of evidence, combined with the findings of previous studies, 61 challenges the notion that a primary goal of the system was to unify the country culturally, satisfy military needs or expand state institutions. 62 Instead, we argue that the railway companies prioritised economic factors as a means of profit maximisation – a more immediate and concrete objective that often aligned with the liberal state's aim of connecting the most important administrative and political centres.
Finally, this article offers a new perspective on the literature that examines the performance of the Spanish railway sector. Sometimes, the failure of the railway sector has been attributed to the non-prioritisation of economic considerations – often linked to an inadequate radial design – during the network expansion.
63
Our model, however, provides limited support for this hypothesis and suggests that future research should further examine the interaction between legislation, business practices and the cost-benefit trade-offs in route design. Specifically, our results better support the following ideas:
In the nineteenth century, Spain developed a relatively extensive railway network in a remarkably short period, despite its small population and limited economic development. Over-optimistic forecasts and speculative ventures contributed to a rapid expansion that entailed high construction and financing costs, while actual demand remained low.
64
The management of the railway companies during the construction phase might have been marred by alleged fraud, with managers diverting funds from the Spanish Treasury to pay dividends instead of properly executing projects. Government subsidies tied to payments per kilometre may have incentivised private and foreign investors to prioritise track length over quality, contributing to substandard infrastructure and higher operating costs.
65
Conclusion
This study analysed the local determinants of the development of the Spanish railway network in the nineteenth century, focusing on the two construction waves usually identified in the literature (1848–1876 and 1877–1910). Using a newly created dataset and a Cox proportional hazards model, we examined the economic, political and administrative, and geographical factors that influenced the likelihood of municipalities being connected to the railway during each period. Specifically, the model incorporated variables such as population size, proximity to economic centres and ruggedness of terrain, allowing to assess the impact of these factors over time.
The main conclusion of this article is that, in a first wave (1848–1876), economic factors such as population, industrial activity or construction costs predominated over political and administrative factors in the allocation of stations. The railway network was first extended to the wealthier and more populous municipalities. In the second wave, from 1877, there was a shift towards a more equitable and state-building approach, in which political and administrative priorities gained prominence alongside economic considerations. Even so, it is crucial to recognise that these economic and political drivers were not mutually exclusive; the commercial objectives of railway companies often aligned with the liberal state's interest in connecting key administrative centres, which were usually also the most economically active areas.
This pattern is consistent with the path described by Heinze and Kill for German railways. 66 In fact, it assumes a rather predictable sequence for railway expansion in the nineteenth century. We argue that the interest of the Spanish case lies in the observation that the state's largely facilitative role in the construction process – providing financial support and general guidelines but leaving route decisions to the companies – did not produce an outcome significantly different from that in Germany or France, where the state exerted greater control. However, the economic returns of the railway sector differed significantly: German railways generally remained profitable, 67 while Spanish companies struggled with low profitability and frequent bankruptcies during this period. 68 Consequently, these challenges are more likely to be due to insufficient demand and corporate mismanagement than to an expansion sequence that failed to prioritise economic considerations.
Footnotes
Acknowledgements
The authors are grateful to Mateu Morillas Torné for assistance in filtering the database, and to Pedro Antonio Pérez Pascual and María Jesús Arrazola Vacas for their valuable suggestions regarding the econometric model. They also wish to thank Alfonso Herranz Loncán for his critical analysis of earlier drafts, which undoubtedly helped them to improve the manuscript. Needless to say, any remaining errors are entirely the authors’ responsibility.
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship and/or publication of this article.
Funding
The author disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: “How Transport Infrastructure Has Shaped European Integration: A Long-Term Approach (19th–21st Centuries)” (Activity: ERASMUS-JMO-2021-HEI-TCH-RSCH, Project No. 101047906), from the Departament de Recerca i Universitats de la Generalitat de Catalunya (Grant No. 2001 SGR 01369); and from the programme of Predoctoral Contracts for Trainee Staff in Departments of the Rey Juan Carlos University.
Notes
Appendix
Cox regression estimates of railway access for Spanish municipalities that had more than 5,000 inhabitants in the year 1860, 1848–1910.
| Hazard rates for railway access: | Both waves (1) | First wave (2) | Second wave (3) |
|---|---|---|---|
| ln population size (1860) | 1.833 *** | 2.089 *** | |
| (0.39) | (0.057) | ||
| ln population size (1877) | 1.912 ** | ||
| (0.60) | |||
| ln ruggedness | 0.641 *** | 0.498 *** | 0.85 |
| (0.09) | (0.112) | (0.19) | |
| Mountain (1 = yes) | - | - | - |
| District capital | 0.971 | 0.830 | 1.045 |
| (0.184) | (0.220) | (0.283) | |
| ln distance to nearest provincial capital | 0.638 *** | 0.587 *** | 0.724 |
| (0.095) | (0.113) | (0.198) | |
| ln distance to Madrid | 0.243 * | 0.437 | 0.053 ** |
| (0.195) | (0.486) | (0.072) | |
| ln distance to Barcelona | 0.343 * | 0.318 * | 3.462 |
| (0.200) | (0.206) | (6.84) | |
| ln distance to nearest 1847 main road | 0.793 *** | 0.737 *** | |
| (0.039) | (0.045) | ||
| ln distance to nearest 1877 main road | 0.964 | ||
| (0.099) | |||
| ln distance to nearest nav. river or canal | 0.838 | 1.010 | 0.755 |
| (0.106) | (0.184) | (0.135) | |
| Access to main port | 2.983 ** | 0.934 | 11.76 *** |
| (1.50) | (0.778) | (8.705) | |
| Observations | 496 | 496 | 385 |
Notes: Stratified variables: provincial capital binary and provincial dummy. The coefficient for mountain is not reported because there are not enough municipalities located at over 1,000 metres and that had more than 5,000 inhabitants; 108 and 82 municipalities received access prior to 1877 and 1910, respectively.
Significance at the 10% level.
Significance at the 5% level.
Significance at the 1% level.
