This paper studies the role played by different trade barriers (transport costs, customs and currency) in the evolution of Spanish imports during the First Globalization (1870-1913). Through the estimation of several gravity equations with panel data analysis, we obtain the elasticities of imports to each barrier, which allows us to combine them into a single ad valorem measure of barriers to trade (which we call the trade costs tariff equivalent). More interestingly, the contribution of the barriers to the profile of the tariff equivalent, as well as the assignment of an active role to the peseta exchange rate as a barrier, illustrates the existence of a protectionist backlash against the sustained decline in transport costs in the period 1870-1913.