This study shows for a large sample of R&D-active manufacturing firms that collaborative R&D has a positive effect on firms' patenting in terms of both quantity and quality. When distinguishing between alliances that aim at joint creation of new knowledge and alliances that aim at exchange of existing knowledge, the results suggest that the positive effect on patent quantity is driven by knowledge exchange rather than joint R&D. Firms engaged in joint R&D, on the other hand, receive more forward citations per patent indicating that joint R&D enhances patent quality. In light of literature on strategic patenting, our results further suggest that knowledge creation alliances lead to patents that are filed to protect valuable intellectual property, while exchange alliances drive portfolio patenting, resulting in fewer forward citations.