What is the effect of imports on productivity? To answer this question, we estimate a structural model of producers using product-level import data for a panel of Hungarian manufacturing firms from 1992 to 2001. In our model with heterogenous firms, producers choose to import or purchase domestically varieties of intermediate inputs. Imports affect firm productivity through expanding variety as well as improved input quality. The model leads to a production function where the total factor productivity of a firm depends on the share of inputs imported. To estimate this import-augmented production function, we extend the Olley and Pakes (1996) procedure for a setting with an additional state variable, the number of input varieties imported. Our results suggest that the role of imports is both statistically and economically significant. Imports are responsible for 30% of the growth in aggregate total factor productivity in Hungary during the 1990s. About 50% of this effect is through imports advancing firm level productivity, while the remaining 50% comes from the reallocation of capital and labor to importers.