This article analyses the impact that R&D expenditures and intra-and inter-industry externalities have on the performance of Spanish firms. Despite the extensive literature studying the relationship between innovation and productivity, there are far fewer studies in this particular area examining the importance of sectoral externalities, especially focused on Spain. One novelty of this study, conducted for the industrial and service sectors, is that we also consider the technology level of the sector in which the firm operates and firm size. The database used is the Technological Innovation Panel (PITEC). It comprises 9,985 firms over the period 2004-2009 and has been used infrequently for studies of this type. The Olley and Pakes (1996) estimator is adopted in order to account for both simultaneity and selection biases providing consistent estimates. The results suggest that, unlike previous studies, R&D expenditures do not have a direct impact on firm performance. By contrast, spillovers do. In particular, intra-industry externalities present a positive and significant effect in low-tech and large firms. Inter-industry externalities, however, present an ambiguous effect and there appears to be no specific pattern of behaviour associated with technology level or firm size.