This paper analyzes the effect of agglomeration economies on firms' total factor productivity. We propose the use of a control function approach to overcome the econometric issue inherent to the two-stage approach commonly used in the literature. Estimations are conducted separately for four industry groups, defined by technological intensity, to allow for non-uniform effects of agglomeration economies on firms given their technological level. In addition, R&D is included to account for the firms' own efforts to foster productivity through creating and absorbing knowledge. Finally, radii as well as administrative boundaries are used for defining regions. The results confirm differences in the strength and even in the direction of agglomeration economies: While urban economies have the largest effect on TFP for firms in high-tech industries, they have no effect on TFP in low-tech industries. For firms in the latter industries, however, the variety of the local economic structure has an impact, while this is irrelevant for the TFP of firms in high-tech industries. Only localization economies have a positive and significant effect on TFP throughout, but the effect increases with technological intensity of industries. Throughout, R&D is also found to have a positive effect that increases with technological intensity.