Using a large unbalanced panel dataset of more than 12,000 Italian manufacturing firms for the period 1999-2007, this paper investigates the role of geographic concentration and related variety on firms' total factor productivity (TFP). The main idea is that diversificationcaptured by a measure of vertically related varietypromotes firm innovativeness and, consequently, productivity, but when the technology has been consolidated, firms join specialized clusters that enhance efficiency. Our results suggest that the effect on firms' TFP of geographic concentration is stronger than that of related variety. We also confirm previous findings on the relevance of agglomeration forces for small firms compared with medium and large firms, where these agglomerative forces do not seem to influence TFP.