The impact of international students and skilled immigration in the United States on innovative activity is estimated using a model of idea generation. In the main specification a system of three equations is estimated, where dependent variables are total patent applications, patents awarded to U.S. universities, and patents awarded to other U.S. entities, each scaled by the domestic labor force. Results indicate that both international graduate students and skilled immigrants have a significant and positive impact on future patent applications as well as future patents awarded to university and non-university institutions. Our central estimates suggest that a ten-percent increase in the number of foreign graduate students would raise patent applications by 3.3 percent, university patent grants by 6.0 percent and non-university patent grants by 4.0 percent. However, enrollments of US graduate students have no detectable effect. There is evidence that bureaucratic hurdles in obtaining student visas are impediments to innovation and may reduce innovation by more than it is increased by the Bayh-Dole Act.