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 of both the merged entity and 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 empirical 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 effects are concentrated in markets with high innovation intensity and a high degree of firm heterogeneity. The results are robust towards alternative specifications, using an instrumental variable strategy, and applying a propensity score matching estimator.