In this article, we combine data from the housing market with data from a victimization survey to estimate the effect of crime perception on housing prices in the City of Barcelona from 2004 to 2006. Using dwelling data and a hedonic price model (using both OLS and quantile regressions), in the first stage, we estimate the shadow price of the location of dwellings. In the second stage, we analyse the impact of crime perception, after controlling for other district characteristics such as local public spending and immigration, on this locational valuation. After accounting for the possible endogeneity of crime and housing prices, our findings suggest that crime exerts relevant costs beyond its direct costs. Indeed, a one standard deviation increase in perceived security is associated with a 0.57 % increase in the valuation of districts. Moreover, in districts perceived as being less safe than the average for the City of Barcelona, houses are highly discounted. Less safe districts have on average a valuation that is 1.27 % lower.