The objective of this paper is to analyze why firms in some industries locate in specialized economic environments (localization economies) while those in other industries prefer large city locations (urbanization economies). To this end, we examine the location decisions of new manufacturing firms in Spain at the city level and for narrowly defined industries (three-digit level). First, we estimate firm location models to obtain estimates that reflect the importance of localization and urbanization economies in each industry. In a second step, we regress these estimates on industry characteristics that are related to the potential importance of three agglomeration theories, namely, labor market pooling, input sharing and knowledge spillovers. Localization effects are low and urbanization effects are high in knowledge-intensive industries, suggesting that firms (partly) locate in large cities to reap the benefits of inter-industry knowledge spillovers. We also find that localization effects are high in industries that employ workers whose skills are more industry-specific, suggesting that industries (partly) locate in specialized economic environments to share a common pool of specialized workers.