We characterize the contribution of immigrants to U.S. innovation, both through their direct productivity as well as through their indirect spillover effects on their native collaborators. To do so, we link patent records to a database containing the first five digits of 160 million of Social Security Numbers (SSN). By combining this part of the SSN together with year of birth, we identify whether individuals are immigrants based on the age at which their Social Security Number is assigned. We find that over the course of their careers, immigrants are more productive than natives, as measured by number of patents, patent citations, and the economic value of these patents. Immigrant inventors are more likely to rely on foreign technologies, to collaborate with foreign inventors, and to be cited in foreign markets, thus contributing to the importation and diffusion of ideas across borders. Using an identification strategy that exploits premature inventor deaths, we find that immigrants collaborators create especially strong positive externalities on the innovation production of natives, while natives create especially large positive externalities on immigrant innovation production, suggesting that combining these different knowledge pools into inventor teams is important for innovation. A simple decomposition suggests that despite immigrants only making up 16% of inventors, they are responsible for 30% of aggregate U.S. innovation since 1976, with their indirect spillover effects accounting for more than twice their direct productivity contribution.