This papers analyses how horizontal mergers affect innovation activities of the merged entity and its non-merging competitors. We develop an oligopoly model with heterogeneous firms to derive empirically testable implications. Our model predicts that a merger is more likely to be profitable in an innovation intensive industry. For a high degree of firm heterogeneity a merger reduces innovation in both the merged entity and in non-merging competitors in an industry with high R\&D intensity. Using data on horizontal mergers among pharmaceutical firms in Europe, we find that our econometric results are consistent with many predictions of the theoretical model. Our main result is that after a merger patenting and R\&D of the merged entity and its non-merging rivals declines substantially. The results are robust towards alternative specifications and using an instrumental variable strategy.